X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=blobdiff_plain;f=yoweb-scrape;h=cc98ea3b21b869154ed0a46ca5aec941d7f71a71;hp=c99b2b0c684362f3db3b4507823bba7af6bb2ce9;hb=16509b590987a0b966a326b6d39d8a2d553582be;hpb=ac1596d63e8e8107a58bd7a65adf46c8efabcc53 diff --git a/yoweb-scrape b/yoweb-scrape index c99b2b0..cc98ea3 100755 --- a/yoweb-scrape +++ b/yoweb-scrape @@ -482,7 +482,8 @@ class ChatLogTracker: m = rm('=+ (\\d+)/(\\d+)/(\\d+) =+$') if m: - self._date = m.groups() + self._date = [int(x) for x in m.groups()] + self._previous_timestamp = None return d('date '+`self._date`) if self._date is None: @@ -492,9 +493,18 @@ class ChatLogTracker: if not m: return d('no timestamp') - time_tuple = [int(x) for x in self._date + m.groups()] - time_tuple += (-1,-1,-1) - timestamp = time.mktime(time_tuple) + while True: + time_tuple = (self._date + + [int(x) for x in m.groups()] + + [-1,-1,-1]) + timestamp = time.mktime(time_tuple) + if timestamp >= self._previous_timestamp: break + self._date[2] += 1 + self._debug_line_disposition(timestamp,'', + 'new date '+`self._date`) + + self._previous_timestamp = timestamp + l = l[l.find(' ')+1:] def ob_x(who,event):