From c1f55148710340aad66796dab67e5b7376f04f9b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 17 May 2009 14:07:47 +0100 Subject: [PATCH] prettier startup output --- yoweb-scrape | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/yoweb-scrape b/yoweb-scrape index ed9533e..0360745 100755 --- a/yoweb-scrape +++ b/yoweb-scrape @@ -884,9 +884,9 @@ def prep_chat_log(args, bu, if not match: bu('chat log filename is not in expected format') (pirate, ocean) = match.groups() fetcher.default_ocean(ocean) - - myself = PirateInfo(pirate,max_myself_age) + progress.show_init(pirate, fetcher.ocean) + myself = PirateInfo(pirate,max_myself_age) track = ChatLogTracker(myself, logfn) opts.debug -= 2 @@ -983,30 +983,29 @@ def do_ship_aid(args, bu): displayer.realstart() - while True: - track.catchup() - now = time.time() - - s = "%s" % track.myname() - + def find_vessel(): vn = track.vesselname() - if vn is not None: - s += " on board the %s" % vn + if vn: return (vn, " on board the %s" % vn) + vn = track.lastvesselname() + if vn: return (vn, " ashore from the %s" % vn) + return (None, " not on a vessel") - if vn is None: - vn = track.lastvesselname() - if vn is not None: - s += " ashore from the %s" % vn + displayer.show(track.myname() + find_vessel()[1] + '...') - if vn is None: - s += " not on a vessel" + while True: + track.catchup() + now = time.time() + (vn, s) = find_vessel() + s = track.myname() + s s += " at %s\n" % time.strftime("%Y-%m-%d %H:%M:%S") tbl = StandingsTable() tbl.headings() - for pa in track.aboard(): + aboard = track.aboard(vn) + + for pa in aboard: pi = pa.pirate_info() xs = '' -- 2.30.2