Skip to content
Snippets Groups Projects
Commit cb1c771c authored by Florian Obersteiner's avatar Florian Obersteiner
Browse files

bugfix of the bugfix - should really write tests first

parent 0f96aa79
No related branches found
No related tags found
1 merge request!11__version__ from package metadata
Pipeline #23 passed
......@@ -214,10 +214,14 @@ class KeywordComment:
class StandardNormalComments(collections.UserList):
@property
def nlines(self):
n = 1 # shortnames line, and keywords might be multiline...
n += len(self.freeform)
n += sum(len(k.data[0].split("\n")) or 1 for k in self.keywords.values())
# was: len(self.freeform) + 1 + sum([len(k.data) for k in self.keywords.values()])
"""calculates the number of lines in the normal comments section"""
n = 1 # shortnames line
n += len(self.freeform) # freeform comment
for k in self.keywords.values():
try:
n += len(k.data[0].split("\n")) # and keywords might be multiline...
except IndexError: # ok we have no list,
n += 1 # just add 1
return n
@property
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment