From 2ddcf0c1db5f3b538451aacea480999d2bc5a046 Mon Sep 17 00:00:00 2001 From: Morgan Collett Date: Fri, 27 Jun 2008 17:24:12 +0000 Subject: #6036: Don't show multiple consecutive timestamps --- diff --git a/pippy_app.py b/pippy_app.py index 54811a3..3be11c6 100644 --- a/pippy_app.py +++ b/pippy_app.py @@ -469,15 +469,19 @@ class Chat(ViewSourceActivity): """ logger.debug('read_file: reading %s' % file_path) log = open(file_path).readlines() + last_line_was_timestamp = False for line in log: if line.endswith('\t\t\n'): - timestamp = line.strip().split('\t')[0] - self.add_separator(timestamp) + if last_line_was_timestamp is False: + timestamp = line.strip().split('\t')[0] + self.add_separator(timestamp) + last_line_was_timestamp = True else: timestamp, nick, color, status, text = line.strip().split('\t') status_message = bool(int(status)) self.add_text({'nick': nick, 'color': color}, text, status_message) + last_line_was_timestamp = False def _show_via_journal(self, url): """Ask the journal to display a URL""" -- cgit v0.9.1