chiark / gitweb /
chat log tracker mostly works
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 16 May 2009 17:14:34 +0000 (18:14 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 16 May 2009 17:14:34 +0000 (18:14 +0100)
yoweb-scrape

index 9d8f69d..f66dda1 100755 (executable)
@@ -410,10 +410,10 @@ class ChatLogTracker:
                self._vessel = None     #       self._vl[self._vessel]
                self._date = None
                self._myself = myself_pi
-               self._need_redisplay = False
+               self.need_redisplay = False
 
        def _refresh(self):
-               self._need_redisplay = True
+               self.need_redisplay = True
 
        def _onboard_event(self,timestamp,pirate,event):
                try: pa = self._pl[pirate]
@@ -434,6 +434,7 @@ class ChatLogTracker:
                for pn in v:
                        if pn.startswith('#'): continue
                        del self._pl[pn]
+               self._refresh()
 
        def expire_garbage(self, timestamp):
                for (vn,v) in list(self._vl.iteritems()):
@@ -617,12 +618,13 @@ def do_ship_aid(args, bu):
                if l.endswith('\n'):
                        track.chatline(l.rstrip())
                        l = ''
-                       print track
                        continue
                if l:
                        continue
-               print track
-               os.sleep(1)
+               if track.need_redisplay:
+                       print track
+                       track.need_redisplay = False
+               time.sleep(1)
 
 def main():
        global opts, fetcher