Permalink
Browse files

Space after the >> operator, and blank line before a new function.

  • Loading branch information...
1 parent 75795cf commit d72efa26993b9e90f3fcafc69bef59aecebcd66b @abhinav-upadhyay committed Dec 25, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 bin/mturk
View
3 bin/mturk
@@ -97,14 +97,15 @@ def save_nicknames(nicknames_path = default_nicknames_path):
if nicknames != original_nicknames:
with open(nicknames_path, 'w') as o:
json.dump(nicknames, o, sort_keys = True, indent = 4)
- print >>o
+ print >> o
time_units = dict(s = 1, min = 60, h = 60 * 60, d = 24 * 60 * 60)
def parse_duration(s):
'''Parses durations like "2 d", "48 h", "2880 min",
"172800 s", or "172800".'''
x = s.split()
return int(x[0]) * time_units['s' if len(x) == 1 else x[1]]
+
def display_duration(n):
for unit, m in sorted(time_units.items(), key = lambda x: -x[1]):
if n % m == 0:

0 comments on commit d72efa2

Please sign in to comment.