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

Preserve comments in dump() method #1327

Merged
merged 12 commits into from
Aug 5, 2015
Merged

Conversation

Caylo
Copy link
Contributor

@Caylo Caylo commented Jul 17, 2015

At the moment, there's no support for comments on lines that do not contain keys because for that to work, dump's indentation needs to be fixed first

for example, right now, the comment in

dependencies = [
    ('JasPer', '1.900.1'),
    ('grib_api', '1.9.18'),
    ('netCDF', '4.1.3'),  # can't use 4.2, because Fortran stuff is in seperate netCDF-Fortran install
]

will be ignored. This will have to be fixed when I take care of the indentation.

@hpcugentbot
Copy link
Contributor

Automatic reply from Jenkins: Can I test this?

header = True

i = 0
while i<len(raw):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use a for loop?
precompute len(raw) so it's not computed on every itteration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not a for loop because the counter needs to be incremented more if there are multiline comments (the nested loop on line 164)

@JensTimmerman
Copy link
Contributor

jenkins: ok to test

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1922/
EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1922/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1923/
EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1923/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@Caylo Caylo mentioned this pull request Jul 28, 2015
printed_keys.append(key)
printed = True
if printed:
ebtxt.append('')

def add_key_and_comments(key, val):
""" Adds key, value pair and comments (if there are any) to the dump file """
if key in self.comments['inline']:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's ugly to use the self from the outer scope,
can't you make this a private method instead of an inner method, and pass self along?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'outer scope' is overstating things a bit, this inner function (in a method) is just referring to a 'variable' that's available in that methods scope, which is fine

moving that function out of the method, either as private method or a stand-alone function, would be messier imho (since it'll be split of from its context)

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1930/
EasyBuild framework unit test suite FAILed.

See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1930/console for more details.

Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do.

boegel and others added 2 commits August 5, 2015 12:01
dance around issue with get_config_dict triggering a (re)parse, which…
@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1931/
EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1931/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@boegel
Copy link
Member

boegel commented Aug 5, 2015

going in, follow-up in #1330

boegel added a commit that referenced this pull request Aug 5, 2015
Preserve comments in dump() method
@boegel boegel merged commit c7a3777 into easybuilders:develop Aug 5, 2015
@Caylo Caylo deleted the dump-comments branch June 28, 2016 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants