Skip to content

Commit

Permalink
Merge pull request #7 from boegel/dump-comments
Browse files Browse the repository at this point in the history
dance around issue with get_config_dict triggering a (re)parse, which…
  • Loading branch information
Caylo committed Aug 5, 2015
2 parents 1c04214 + a60754c commit 4aacbbf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions easybuild/framework/easyconfig/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ def _extract_comments(self):
while rawlines[0].startswith('#'):
self.comments['header'].append(rawlines.pop(0))

parsed_ec = self.get_config_dict()

parsed_ec = None
while rawlines:
rawline = rawlines.pop(0)
if rawline.startswith('#'):
Expand All @@ -171,6 +170,11 @@ def _extract_comments(self):
self.comments['above'][key] = comment

elif '#' in rawline: # inline comment
if parsed_ec is None:
# obtain parsed easyconfig as a dict, if it wasn't already
# note: this currently trigger a reparse
parsed_ec = self.get_config_dict()

key = rawline.split('=', 1)[0].strip()
comment = rawline.rsplit('#', 1)[1].strip()

Expand Down

0 comments on commit 4aacbbf

Please sign in to comment.