From: Ian Jackson Date: Sun, 17 May 2009 09:41:43 +0000 (+0100) Subject: Revamp machinery for lookup up ships in chat log tracker X-Git-Tag: 1.0~38 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=commitdiff_plain;h=90592afd5da5f25e5a256f11186d851b4a149f47;hp=8bdbeb92cee0d79d18d9a0163d0f6db5a4f3d3b5 Revamp machinery for lookup up ships in chat log tracker --- diff --git a/yoweb-scrape b/yoweb-scrape index 841430b..720e886 100755 --- a/yoweb-scrape +++ b/yoweb-scrape @@ -39,7 +39,7 @@ max_pirate_namelen = 12 def debug(m): if opts.debug > 0: - print m + print >>opts.debug_file, m def format_time_interval(ti): if ti < 120: return '%d:%02d' % (ti / 60, ti % 60) @@ -917,7 +917,7 @@ display modes (for --display) apply to ship-aid: help='cache yoweb pages in DIR') ao('-D','--debug', action='count', dest='debug', default=0, help='enable debugging output') - ao('--debug-fd', action='count', dest='debug_fd', + ao('--debug-fd', type='int', dest='debug_fd', help='write any debugging output to specified fd') ao('-q','--quiet', action='store_true', dest='quiet', help='suppress warning output') @@ -937,7 +937,9 @@ display modes (for --display) apply to ship-aid: pa.error('need a mode argument') if opts.debug_fd is not None: - opts.debug_file = fdopen(opts.debug_fd, 'w') + opts.debug_file = os.fdopen(opts.debug_fd, 'w') + else: + opts.debug_file = sys.stdout mode = args[0] mode_fn_name = 'do_' + mode.replace('_','#').replace('-','_')