[Python-checkins] r83137 - tracker/instances/python-dev/extensions/local_replace.py

ezio.melotti python-checkins at python.org
Sat Jul 24 17:14:39 CEST 2010


Author: ezio.melotti
Date: Sat Jul 24 17:14:38 2010
New Revision: 83137

Log:
Fix a couple of XXX.

Modified:
   tracker/instances/python-dev/extensions/local_replace.py

Modified: tracker/instances/python-dev/extensions/local_replace.py
==============================================================================
--- tracker/instances/python-dev/extensions/local_replace.py	(original)
+++ tracker/instances/python-dev/extensions/local_replace.py	Sat Jul 24 17:14:38 2010
@@ -77,16 +77,10 @@
                                status=status, text=text)
 
 
-# XXX there should be only one regex for this
-noise_change = re.compile('(nosy_count|message_count)\: \d+\.0 -> \d+\.0')
-noise_init = re.compile('(nosy_count|message_count)\: \d+\.0')
-# XXX this shouldn't be a regex
-br = re.compile('<td><br />')
+noise_changes = re.compile('(nosy_count|message_count)\: \d+\.0( -> \d+\.0)?')
 
 def clean_count(history):
-    history = noise_change.sub('', history)
-    history = noise_init.sub('', history)
-    history = br.sub('<td>', history)
+    history = noise_changes.sub('', history).replace('<td><br />', '<td>')
     return history
 
 def init(instance):


More information about the Python-checkins mailing list