From: Ian Jackson Date: Sun, 17 May 2009 10:06:38 +0000 (+0100) Subject: ChatLogTracker.chatline::disembark takes vessel and timestamp arguments X-Git-Tag: 1.0~36 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-test.git;a=commitdiff_plain;h=4d3174a853d79e278d81345057e7cc89dd152048;hp=d759000ee3d3e189ab8e8305ec0ea97bc9889e5a ChatLogTracker.chatline::disembark takes vessel and timestamp arguments --- diff --git a/yoweb-scrape b/yoweb-scrape index 93ce317..0ceeaa1 100755 --- a/yoweb-scrape +++ b/yoweb-scrape @@ -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')