Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dance around issue with get_config_dict triggering a (re)parse, which… #7

Merged
merged 1 commit into from
Aug 5, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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