[Python-checkins] r71035 - tracker/instances/python-dev/detectors/reopenpending.py

sean.reifschneider python-checkins at python.org
Thu Apr 2 06:10:08 CEST 2009


Author: sean.reifschneider
Date: Thu Apr  2 06:10:08 2009
New Revision: 71035

Log:
Auditor to change the status of pending issues to "open" when they are touched.


Added:
   tracker/instances/python-dev/detectors/reopenpending.py

Added: tracker/instances/python-dev/detectors/reopenpending.py
==============================================================================
--- (empty file)
+++ tracker/instances/python-dev/detectors/reopenpending.py	Thu Apr  2 06:10:08 2009
@@ -0,0 +1,14 @@
+def reopen_pending(db, cl, nodeid, newvalues):
+    """Re-open pending issues when the issue is updated."""
+
+    if newvalues.has_key('status'): return
+
+    if nodeid is None: oldStatus = None
+    else: oldStatus = cl.get(nodeid, 'status')
+    if oldStatus == db.status.lookup('pending'):
+        newvalues['status'] = db.status.lookup('open')
+
+
+def init(db):
+    # fire before changes are made
+    db.issue.audit('set', reopen_pending)


More information about the Python-checkins mailing list