This repository has been archived by the owner on Mar 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 147
Python 3 Support #1
Comments
Output of futurize: --- ScriptedInstaller.py (original)
+++ ScriptedInstaller.py (refactored)
@@ -1,4 +1,6 @@
from __future__ import print_function
+from builtins import map
+from builtins import str
import sys
import os
import re
@@ -183,9 +185,9 @@
try:
secrets = read_json_file(options.secretsFile)
# be sure they have at least initial user and password
- if require_initialuser and not 'content_admin_user' in secrets.keys():
+ if require_initialuser and not 'content_admin_user' in list(secrets.keys()):
raise ValidationError('Missing content_admin_user in secrets file "%s"' % options.secretsFile)
- if require_initialuser and not 'content_admin_pass' in secrets.keys():
+ if require_initialuser and not 'content_admin_pass' in list(secrets.keys()):
raise ValidationError('Missing content_admin_pass in secrets file "%s"' % options.secretsFile)
return secrets
except IOError as ex:
@@ -275,7 +277,7 @@
# parameter must be in keys, and must not be null, emtpy, or just whitespace
def must_set_value_for_parameter(param_map, parameter):
- return parameter in param_map.keys() and not(not param_map[parameter] or param_map[parameter].isspace())
+ return parameter in list(param_map.keys()) and not(not param_map[parameter] or param_map[parameter].isspace()) Everything else is already compatible (I'm also not confidant the import stuff is necessary, that seems to be a quirk of the tool) |
Will there be and official version that support python 3+? |
We don't currently have plans to update with an new version that supports Python 3+, but you are welcome to take the script and make the necessary modifications for your own use. |
Can't promise a timeline, but if this is as simple as I think, I'll try and get to it within the next month. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
After a quick glance at the code, I don't see any reason why this couldn't work with Py3.
In fact, I see more code written to prevent python3 than I think would be required to be compatible with python 3 :)
I'll take a more in depth review later and submit a PR
(I may just run futurize over it and compare the output)
The text was updated successfully, but these errors were encountered: