git://git.novaco.in
/
p2pool.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
396e51e
)
reorganized format_dt
author
Forrest Voight
<forrest@forre.st>
Sun, 24 Nov 2013 06:27:30 +0000 (
01:27
-0500)
committer
Forrest Voight
<forrest@forre.st>
Sun, 24 Nov 2013 06:27:30 +0000 (
01:27
-0500)
p2pool/util/math.py
patch
|
blob
|
history
diff --git
a/p2pool/util/math.py
b/p2pool/util/math.py
index
6ceb9ff
..
71b5dec
100644
(file)
--- a/
p2pool/util/math.py
+++ b/
p2pool/util/math.py
@@
-82,7
+82,13
@@
def format(x):
return '%i' % (x,) + s
def format_dt(dt):
- for value, name in [(365.2425*60*60*24, 'years'), (60*60*24, 'days'), (60*60, 'hours'), (60, 'minutes'), (1, 'seconds')]:
+ for value, name in [
+ (365.2425*60*60*24, 'years'),
+ (60*60*24, 'days'),
+ (60*60, 'hours'),
+ (60, 'minutes'),
+ (1, 'seconds'),
+ ]:
if dt > value:
break
return '%.01f %s' % (dt/value, name)