[Python-checkins] r70304 - in tracker/instances/python-dev: detectors/sendmail.py extensions/local_replace.py html/issue.item.html html/page.html

martin.v.loewis python-checkins at python.org
Wed Mar 11 00:01:49 CET 2009


Author: martin.v.loewis
Date: Wed Mar 11 00:01:46 2009
New Revision: 70304

Log:
Issue #249: Clear _count attributes out of various places.
This is supposed to be a temporary change, to be reverted when
something better arrives.


Modified:
   tracker/instances/python-dev/detectors/sendmail.py
   tracker/instances/python-dev/extensions/local_replace.py
   tracker/instances/python-dev/html/issue.item.html
   tracker/instances/python-dev/html/page.html

Modified: tracker/instances/python-dev/detectors/sendmail.py
==============================================================================
--- tracker/instances/python-dev/detectors/sendmail.py	(original)
+++ tracker/instances/python-dev/detectors/sendmail.py	Wed Mar 11 00:01:46 2009
@@ -73,6 +73,10 @@
         changenote = cl.generateChangeNote(nodeid, oldvalues)
         oldfiles = oldvalues.get('files', [])        
 
+    # Silence nosy_count/message_count
+    lines = changenote.splitlines()
+    changenote = '\n'.join(line for line in lines if '_count' not in line)
+
     newfiles = db.issue.get(nodeid, 'files', [])
     if oldfiles != newfiles:
         added = [fid for fid in newfiles if fid not in oldfiles]

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	Wed Mar 11 00:01:46 2009
@@ -18,12 +18,20 @@
         message = cre.sub(replacement, message)
 
     return message
-        
-    
-    
+
+noise_change = re.compile('(nosy_count|message_count)\: \d+\.0 -> \d+\.0')
+noise_init = re.compile('(nosy_count|message_count)\: \d+\.0')
+br = re.compile('<td><br />')
+
+def clean_count(history):
+    history = noise_change.sub('', history)
+    history = noise_init.sub('', history)
+    history = br.sub('<td>', history)
+    return history
+
 def init(instance):
     instance.registerUtil('localReplace', localReplace)
-    
+    instance.registerUtil('clean_count', clean_count)
 
 if "__main__" == __name__:
     print " revision 222", localReplace(" revision 222")
@@ -31,4 +39,4 @@
     print " r222", localReplace(" r222")
     print " r 222", localReplace(" r 222")
     print " #555", localReplace(" #555")
-    
+

Modified: tracker/instances/python-dev/html/issue.item.html
==============================================================================
--- tracker/instances/python-dev/html/issue.item.html	(original)
+++ tracker/instances/python-dev/html/issue.item.html	Wed Mar 11 00:01:46 2009
@@ -257,7 +257,8 @@
  </tal:block>
 </table>
 
-<tal:block tal:condition="context/id" tal:replace="structure context/history" />
+<tal:block tal:condition="context/id" tal:define="history /context/history"
+           tal:content="structure python:utils.clean_count(history)" />
 
 </div>
 

Modified: tracker/instances/python-dev/html/page.html
==============================================================================
--- tracker/instances/python-dev/html/page.html	(original)
+++ tracker/instances/python-dev/html/page.html	Wed Mar 11 00:01:46 2009
@@ -218,8 +218,9 @@
  <p tal:condition="options/error_message | nothing" class="error-message"
     tal:repeat="m options/error_message" tal:content="structure m" />
  <p tal:condition="options/ok_message | nothing" class="ok-message">
-  <span tal:repeat="m options/ok_message"
-        tal:content="structure string:$m <br/ > " />
+  <span tal:content="structure python:
+        '<br/ >'.join(m.replace('nosy_count', '').replace('message_count', '')
+        for m in options['ok_message']) + '<br/ >'" />
   <a class="form-small" tal:attributes="href request/current_url"
      i18n:translate="">clear this message</a>
  </p>


More information about the Python-checkins mailing list