chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.web-live.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cf4c8a4
)
flush debugging output before sleeping
author
Ian Jackson
<ian@liberator.(none)>
Sun, 17 May 2009 12:00:28 +0000
(13:00 +0100)
committer
Ian Jackson
<ian@liberator.(none)>
Sun, 17 May 2009 12:00:28 +0000
(13:00 +0100)
yoweb-scrape
patch
|
blob
|
history
diff --git
a/yoweb-scrape
b/yoweb-scrape
index 29af391a5257329bc5c42be7def11fc908a631b5..3c42f7e6bfcb4ca16ffdec44463c2cab40722e49 100755
(executable)
--- a/
yoweb-scrape
+++ b/
yoweb-scrape
@@
-41,6
+41,11
@@
def debug(m):
if opts.debug > 0:
print >>opts.debug_file, m
if opts.debug > 0:
print >>opts.debug_file, m
+def sleep(seconds):
+ if opts.debug > 0:
+ opts.debug_file.flush()
+ time.sleep(seconds)
+
def format_time_interval(ti):
if ti < 120: return '%d:%02d' % (ti / 60, ti % 60)
if ti < 7200: return '%2dm' % (ti / 60)
def format_time_interval(ti):
if ti < 120: return '%d:%02d' % (ti / 60, ti % 60)
if ti < 7200: return '%2dm' % (ti / 60)
@@
-103,7
+108,7
@@
class Fetcher:
need_wait = self.need_wait(now)
if need_wait > 0:
debug('Fetcher wait %d' % need_wait)
need_wait = self.need_wait(now)
if need_wait > 0:
debug('Fetcher wait %d' % need_wait)
-
time.
sleep(need_wait)
+ sleep(need_wait)
def fetch(self, url, max_age):
debug('Fetcher fetch %s' % url)
def fetch(self, url, max_age):
debug('Fetcher fetch %s' % url)
@@
-803,7
+808,7
@@
def do_track_chat_log(args, bu):
track.catchup()
if track.changed():
print track
track.catchup()
if track.changed():
print track
-
time.
sleep(1)
+ sleep(1)
#----- ship management aid -----
#----- ship management aid -----
@@
-914,7
+919,7
@@
def do_ship_aid(args, bu):
s += tbl.results()
displayer.show(s)
s += tbl.results()
displayer.show(s)
-
time.
sleep(1)
+ sleep(1)
rotate_nya = rotate_nya[1:3] + rotate_nya[0]
#---------- main program ----------
rotate_nya = rotate_nya[1:3] + rotate_nya[0]
#---------- main program ----------