chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.web-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move format_time_interval to top
[ypp-sc-tools.web-test.git]
/
yoweb-scrape
diff --git
a/yoweb-scrape
b/yoweb-scrape
index a7f4c9be10faab9bceef1439ee44e3fdb59789f1..1450d2029d861a31e48c8050ad0974b2a79baf3c 100755
(executable)
--- a/
yoweb-scrape
+++ b/
yoweb-scrape
@@
-40,6
+40,12
@@
def debug(m):
if opts.debug > 0:
print m
if opts.debug > 0:
print m
+def format_time_interval(ti):
+ if ti < 120: return '%d:%02d' % (ti / 60, ti % 60)
+ if ti < 7200: return '%2dm' % (ti / 60)
+ if ti < 86400: return '%dh' % (ti / 3600)
+ return '%dd' % (ti / 86400)
+
#---------- caching and rate-limiting data fetcher ----------
class Fetcher:
#---------- caching and rate-limiting data fetcher ----------
class Fetcher:
@@
-715,12
+721,6
@@
def do_track_chat_log(args, bu):
print track
time.sleep(1)
print track
time.sleep(1)
-def format_time_interval(ti):
- if ti < 120: return '%d:%02d' % (ti / 60, ti % 60)
- if ti < 7200: return '%2dm' % (ti / 60)
- if ti < 86400: return '%dh' % (ti / 3600)
- return '%dd' % (ti / 86400)
-
def do_ship_aid(args, bu):
if opts.ship_duty is None: opts.ship_duty = True
def do_ship_aid(args, bu):
if opts.ship_duty is None: opts.ship_duty = True