-
Notifications
You must be signed in to change notification settings - Fork 196
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
Python2 to Python3 porting. #57
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your conversion to Python 3. But since you touched the code, you now own it 😉
Please install a PEP 8 linter in your IDE or workflow (like flake8). You will find that code will become readable and consistent eventually (though you should read about and/or ignore warnings you think are misguided).
Also, I didn't like all the open().write()
calls that were already in the code; the files are not closed. But I think this is outside the scope of this small change (which is why I didn't comment).
You should perhaps check out 2to3
which lets you automatically convert to Python 3.
Thanks again for the changes anyway; your code does the job!
|
||
print 'Serving ulogme, see it on http://localhost:' + `PORT` | ||
print('Serving ulogme, see it on http://localhost:',str(PORT)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For it to be a link in the terminal you have to use +
instead of ,
:
print('Serving ulogme, see it on http://localhost:'+str(PORT))
or even better, with F-Strings (but they depend on Python 3.6):
print(f'Serving ulogme, see it on http://localhost:{PORT}'))
print 'error was:' | ||
print e | ||
except Exception as e: | ||
print ('%s probably does not exist, setting empty events list.' % (fname, )) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use white space "Immediately before the open parenthesis that starts the argument list of a function call:":
print('%s probably does not exist, setting empty events list.' % (fname, ))
I tried to fiddle around with the code, but I could not get it working even using Python 2.7. Perhaps the server implementation changed, and is no longer responsive to This is why I hate inheritance - it is coupled with the implementation. I will try to fix it. |
Guess what is written in the README:
cp render/render_settings_example.js render/render_settings.js
2to3 -w export_events.py
rm render/events_*.json render/export_list.json
python export_events.py 😆 It doesn't throw 404's anymore, and seems to work! |
But their is a issue of 404 error with export_list.json. It isn't being generated and I think the problem is with, export_events.py file on line 53.
I didn't understand what is wrong.