chiark / gitweb /
prettier startup output
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 17 May 2009 13:07:47 +0000 (14:07 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 17 May 2009 13:07:47 +0000 (14:07 +0100)
yoweb-scrape

index ed9533e..0360745 100755 (executable)
@@ -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 = ''