chiark / gitweb /
ship-aid counts the number aboard
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 27 May 2009 23:08:43 +0000 (00:08 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 27 May 2009 23:08:43 +0000 (00:08 +0100)
yoweb-scrape

index d42f427..ca704f7 100755 (executable)
@@ -389,7 +389,7 @@ class StandingsTable:
                s += '+' * (standing % 2)
                return s
 
-       def headings(self):
+       def headings(self, lhs=''):
                def puzn_redact(name):
                        if isinstance(name,list):
                                return '/'.join(
@@ -399,7 +399,7 @@ class StandingsTable:
                        if spc < 0: return name
                        return name[0:min(4,spc)] + name[spc+1:]
                self._linecount = -2
-               self._pline('', map(puzn_redact, self._puzzles), None)
+               self._pline(lhs, map(puzn_redact, self._puzzles), None)
                self._linecount = 0
        def literalline(self, line):
                self.s += line + '\n'
@@ -1088,13 +1088,12 @@ def ship_aid_core(myself, track, displayer, kreader):
                s += kreader.info()
                s += '\n'
 
-               tbl = StandingsTable()
-               tbl.headings()
-
                aboard = track.aboard(vn)
-
                sort.lsort_pa(aboard)
 
+               tbl = StandingsTable()
+               tbl.headings(' %d aboard' % len(aboard))
+
                for pa in aboard:
                        pi = pa.pirate_info()