chiark / gitweb /
ChatLogTracker.chatline::disembark takes vessel and timestamp arguments
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 17 May 2009 10:06:38 +0000 (11:06 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 17 May 2009 10:06:38 +0000 (11:06 +0100)
yoweb-scrape

index 93ce317..0ceeaa1 100755 (executable)
@@ -523,9 +523,10 @@ class ChatLogTracker:
                def ob1(did): ob_x(m.group(1), did); return d(did)
                def oba(did): return ob1('%s %s' % (did, m.group(2)))
 
-               def disembark(pirate, event):
-                       ob_x(pirate, 'leaving '+event)
-                       del self._v[pirate]
+               def disembark(v, timestamp, pirate, event):
+                       self._onboard_event(
+                                       v, timestamp, pirate, 'leaving '+event)
+                       del v[pirate]
                        del self._pl[pirate]
 
                m = rm('Going aboard the (\\S.*\\S)\\.\\.\\.$')
@@ -579,7 +580,8 @@ class ChatLogTracker:
                        if cmdr == self._myself.name: how = 'manual: /%s' % cmd
                        else: how = '/%s %s' % (cmd,cmdr)
                        if cmd == 'a': each = ob_x
-                       else: each = disembark
+                       else: each = lambda who,how: disembark(
+                               self._v, timestamp, who, how)
 
                        if vn is not None:
                                vn = vn.title()
@@ -626,7 +628,8 @@ class ChatLogTracker:
 
                m = rm('(\\w+) has left the vessel\.')
                if m:
-                       disembark(m.group(1), 'disembarked')
+                       pirate = m.group(1)
+                       disembark(self._v, timestamp, pirate, 'disembarked')
                        return d('disembarked')
 
                return d('not matched')