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
upgrade to support python3.7 #51
base: master
Are you sure you want to change the base?
Conversation
refer to #50 |
add the |
@@ -150,17 +173,17 @@ def view (id, fileName=''): | |||
gist = _get_gist(id) | |||
# display line delims only if more than one file exists. facilitates piping file content | |||
noDelim = len(gist['files']) == 1 or fileName != '' | |||
for (file, data) in gist['files'].items(): | |||
for (file, data) in list(gist['files'].items()): |
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.
Not so sure why the parentheses are necessary on this line. I think it could be
for file, data in gist['files'].items():
@@ -176,9 +199,9 @@ def get (id, path, fileName=''): | |||
gist = _get_gist(id) | |||
target = os.path.join(path,id) | |||
|
|||
print ('Gist \'{0}\' has {1} file(s)'.format(id, len(gist['files']))) | |||
print(('Gist \'{0}\' has {1} file(s)'.format(id, len(gist['files'])))) |
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.
No need for extra parentheses.
for file in gist['files']: | ||
print (' ' + file) | ||
print((' ' + file)) |
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.
Same here.
else: | ||
print 'Ok. I won\'t download the Gist.' | ||
print('Ok. I won\'t download the Gist.') |
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.
Would be good to standardize on double or single quotes rather than both.
if description and description != '?': | ||
oldgist['description'] = description | ||
if content and content != '?': | ||
for (file, data) in oldgist['files'].items(): | ||
for (file, data) in list(oldgist['files'].items()): |
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.
Again, no paren needed
if _supress == False: | ||
gist = _get_gist(id) | ||
|
||
print ('Gist \'{0}\' Description: {1}'.format(id, gist['description'])) | ||
print(('Gist \'{0}\' Description: {1}'.format(id, gist['description']))) |
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.
Here too
for file in gist['files']: | ||
print (' ' + file) | ||
print((' ' + file)) |
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.
And here
print(textwrap.fill('An easy to use CLI to manage your GitHub Gists. Create, edit, append, view, search and backup your Gists.', defaults.max_width)) | ||
print('') | ||
print('Author: Nik Khilnani - https://github.com/khilnani/gists.cli') | ||
print('') |
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.
Might be preferable to just add \n to the end of other print statements rather than printing out empty strings
@@ -160,7 +160,7 @@ def auth (username, password): | |||
else: | |||
log.debug('OTP not required.') | |||
else: | |||
print 'Github rejected the username and password but didnt send an OTP header. Try again please' | |||
print('Github rejected the username and password but didnt send an OTP header. Try again please') |
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.
*didn't
sys.exit(0) | ||
else: | ||
print 'Uknown Error: ' + str(code) | ||
print('Uknown Error: ' + str(code)) |
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.
Could take advantage of python3's format here
fix the grammar error to support python3.7