Selectively employ one-liner conditionals for brevity.

This commit is contained in:
Jochen Kupperschmidt
2016-06-05 23:06:54 +02:00
parent 822048909b
commit bdcdd8f137

View File

@ -336,10 +336,7 @@ def main():
print('Enter the number of weeks to offset the image (from the left):') print('Enter the number of weeks to offset the image (from the left):')
offset = request_user_input() offset = request_user_input()
if not offset.strip(): offset = int(offset) if offset.strip() else 0
offset = 0
else:
offset = int(offset)
print(( print((
'By default gitfiti.py matches the darkest pixel to the highest\n' 'By default gitfiti.py matches the darkest pixel to the highest\n'
@ -353,10 +350,7 @@ def main():
).format(max_commits(cal))) ).format(max_commits(cal)))
match = request_user_input() match = request_user_input()
if match == 'gitfiti': match = m if (match == 'gitfiti') else 1
match = m
else:
match = 1
print('enter file(s) to load images from (blank if not applicable)') print('enter file(s) to load images from (blank if not applicable)')
img_names = request_user_input().split(' ') img_names = request_user_input().split(' ')