From 17901a7fd29680cdcaa62551b8ac93c53680e20a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 16 May 2009 21:46:12 +0100 Subject: [PATCH] Move format_time_interval to top --- yoweb-scrape | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yoweb-scrape b/yoweb-scrape index a7f4c9b..1450d20 100755 --- a/yoweb-scrape +++ b/yoweb-scrape @@ -40,6 +40,12 @@ def debug(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: @@ -715,12 +721,6 @@ def do_track_chat_log(args, bu): 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 -- 2.30.2