diff options
author | Morgan Collett <morgan.collett@gmail.com> | 2008-06-27 17:24:12 (GMT) |
---|---|---|
committer | Morgan Collett <morgan.collett@gmail.com> | 2008-06-27 17:24:12 (GMT) |
commit | 2ddcf0c1db5f3b538451aacea480999d2bc5a046 (patch) | |
tree | 4fae3bec3406a97a22f99a66909273fb93fa998d | |
parent | 746daff54177892a03f2b175898a2333171edc2e (diff) |
#6036: Don't show multiple consecutive timestamps
-rw-r--r-- | pippy_app.py | 8 |
1 files changed, 6 insertions, 2 deletions
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""" |