changeset 1554:0739c71cc6a6

Made the irssi parser more tolerant (Thanks to "TheAnarcat").
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sat, 16 Sep 2006 12:32:12 +0200
parents 24ef62e7013f
children 0eaaba71dfc0
files MoinMoin/parser/text_irssi.py docs/CHANGES
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/text_irssi.py	Fri Sep 15 19:42:53 2006 +0200
+++ b/MoinMoin/parser/text_irssi.py	Sat Sep 16 12:32:12 2006 +0200
@@ -29,10 +29,10 @@
         lines = self.raw.split('\n')
         # TODO: Add support for displaying things like join and part messages.
         pattern = re.compile(r"""
-            ((\[|\()?                      # Opening bracket for the timestamp (if it exists)
+            ((\[|\()?                      # Opening bracket or paren for the timestamp (if it exists)
                 (?P<time>([\d]?\d[:.]?)+)  # Timestamp as one or more :/.-separated groups of 1 or 2 digits (if it exists)
-            (\]|\))?\s+)?                  # Closing bracket for the timestamp (if it exists) plus whitespace
-            <\s*?(?P<nick>.*?)\s*?>        # Nick
+            (\]|\))?\s+)?                  # Closing bracket or paren for the timestamp (if it exists) plus whitespace
+            \s*<\s*?(?P<nick>.*?)\s*?>     # Nick, maybe preceeded by whitespace, which will apply only if no timestamp
             \s+                            # Space between the nick and message
             (?P<msg>.*)                    # Message
         """, re.VERBOSE + re.UNICODE)
--- a/docs/CHANGES	Fri Sep 15 19:42:53 2006 +0200
+++ b/docs/CHANGES	Sat Sep 16 12:32:12 2006 +0200
@@ -337,6 +337,7 @@
     * Added a module for binary diffs
     * The thread monitor supports the Python 2.5 feature of directly grabbing
       the current stack frames of all threads now so it has become much faster.
+    * Made the irssi parser more tolerant (Thanks to "TheAnarcat").
 
 
 Version 1.5-current: