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

config_parser: further futurize #130

Merged
merged 2 commits into from
Nov 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/omero/install/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def parse_module(self, module='omeroweb.settings'):
from django.conf import settings

for key, values in sorted(
iter(settings.CUSTOM_SETTINGS_MAPPINGS.items()),
iter(list(settings.CUSTOM_SETTINGS_MAPPINGS.items())),
key=lambda k: k):

p = Property()
Expand Down Expand Up @@ -372,8 +372,8 @@ def headers(self):
additional_headers[section] = Header(section)
headers.setdefault(additional_headers[section], []).append(x)

for key in headers.keys():
headers[key].sort(lambda a, b: cmp(a.key, b.key))
for key in list(headers.keys()):
Copy link
Member

Choose a reason for hiding this comment

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

Don't need list here really?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm.... pretty sure this is coming from the call to futurize -w -0, i.e. being overly cautious. Is it worth pushing away?

Copy link
Member

Choose a reason for hiding this comment

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

Probably not worth the trouble.

headers[key].sort(key=lambda x: x.key)
return headers

def print_defaults(self):
Expand Down Expand Up @@ -412,6 +412,8 @@ def print_rst(self):
properties += "%s\n" % underline(len(p.key))
for line in p.txt.split("\n"):
if line:
if isbytes(line):
line = bytes_to_native_str(line)
properties += "%s\n" % (line)
else:
properties += "\n"
Expand Down