[Python-checkins] r52977 - in tracker: importer/sfxml2roundup.py importer/sfxmlhandlers.py instances/python-dev/html/home.html instances/python-dev/html/page.html instances/python-dev/initial_data.py

erik.forsberg python-checkins at python.org
Sat Dec 9 21:28:06 CET 2006


Author: erik.forsberg
Date: Sat Dec  9 21:28:05 2006
New Revision: 52977

Modified:
   tracker/importer/sfxml2roundup.py
   tracker/importer/sfxmlhandlers.py
   tracker/instances/python-dev/html/home.html
   tracker/instances/python-dev/html/page.html
   tracker/instances/python-dev/initial_data.py
Log:

* Implemented simple mapping between sf.net status/resolution and
  new tracker status/resolution:

     Keep old values, except that all issues with Deleted status now get
     the Closed status.

  See http://psf.upfronthosting.co.za/roundup/meta/issue55 for
  details.

  Added new status/resolution values to initial_data.py

* Adapted templates to make default issue listings show only open and
  pending issues.


Modified: tracker/importer/sfxml2roundup.py
==============================================================================
--- tracker/importer/sfxml2roundup.py	(original)
+++ tracker/importer/sfxml2roundup.py	Sat Dec  9 21:28:05 2006
@@ -43,8 +43,9 @@
                 sfxmlhandlers.SeverityHandler(db, None, 'severity'),
                 sfxmlhandlers.PriorityHandler(db, 'priority', 'priority'),
                 sfxmlhandlers.DependencyHandler(db, None, 'dependencies'),
-                sfxmlhandlers.UserlinkHandler(db, 'assigned_to', 'assignee'),
-                sfxmlhandlers.StatusHandler(db, None, None), # Takes care of status and resolution
+                sfxmlhandlers.AssigneeHandler(db, 'assigned_to', 'assignee'),
+                sfxmlhandlers.StatusHandler(db, 'status', 'status'),
+                sfxmlhandlers.ResolutionHandler(db, 'resolution', 'resolution'),
                 ]
 
     roundupdata = {'files':[]}

Modified: tracker/importer/sfxmlhandlers.py
==============================================================================
--- tracker/importer/sfxmlhandlers.py	(original)
+++ tracker/importer/sfxmlhandlers.py	Sat Dec  9 21:28:05 2006
@@ -124,6 +124,16 @@
 
         roundupdata[self.target] = self.getauthor(username)
 
+class AssigneeHandler(UserlinkHandler):
+    def handle(self, fields, roundupdata):
+        UserlinkHandler.handle(self, fields, roundupdata)
+        if None == roundupdata[self.target]:
+            return
+        user = self.db.user.getnode(roundupdata[self.target])
+        roles = user['roles'].split(',')
+        if not "Developer" in roles:
+            roles.append('Developer')
+            user['roles'] = ",".join(roles)
 
 class PriorityHandler(SFXMLHandler):
     def handle(self, fields, roundupdata):
@@ -360,4 +370,15 @@
 
 class StatusHandler(SFXMLHandler):
     def handle(self, fields, roundupdata):
-        return
+        status = fields[self.source].text.lower()
+        if "deleted" == status:
+            status = "closed"
+        roundupdata[self.target] = self.db.status.lookup(status)
+
+class ResolutionHandler(SFXMLHandler):
+    def handle(self, fields, roundupdata):
+        resolution = fields[self.source].text.lower()
+        if "none" == resolution:
+            roundupdata[self.target] = None
+        else:
+            roundupdata[self.target] = self.db.resolution.lookup(resolution)

Modified: tracker/instances/python-dev/html/home.html
==============================================================================
--- tracker/instances/python-dev/html/home.html	(original)
+++ tracker/instances/python-dev/html/home.html	Sat Dec  9 21:28:05 2006
@@ -7,4 +7,4 @@
 <span tal:replace="structure python:db.issue.renderWith('index',
     sort=[('-', 'activity')], group=[('+', 'severity')], filter=['status'],
     columns=['id','activity','title','creator','assignee', 'status'],
-    filterspec={'status':['1','2']})" />
+    filterspec={'status':['1','3']})" />

Modified: tracker/instances/python-dev/html/page.html
==============================================================================
--- tracker/instances/python-dev/html/page.html	(original)
+++ tracker/instances/python-dev/html/page.html	Sat Dec  9 21:28:05 2006
@@ -21,7 +21,7 @@
 kw_create python:request.user.hasPermission('Create', 'keyword');
 columns string:id,activity,title,creator,status;
 columns_showall string:id,activity,title,creator,assignee,status;
-status_notresolved string:-1,1,2,3,4,5,6,7;
+status_notresolved string:-1,1,3;
 ">
   <!--  Logo  -->
   <h1 id="logoheader">

Modified: tracker/instances/python-dev/initial_data.py
==============================================================================
--- tracker/instances/python-dev/initial_data.py	(original)
+++ tracker/instances/python-dev/initial_data.py	Sat Dec  9 21:28:05 2006
@@ -36,15 +36,22 @@
 priority.create(name='low', order='5')
 
 status = db.getclass('status')
-status.create(name='new', order='1')
-status.create(name='open', order='2')
+status.create(name='open', order='1')
+status.create(name='closed', order='2')
 status.create(name='pending', description='user feedback required', order='3')
-status.create(name='closed', order='4')
 
 resolution = db.getclass('resolution')
-resolution.create(name='fixed', order='1')
-resolution.create(name='invalid', order='2')
-resolution.create(name='duplicate', order='3')
+resolution.create(name='accepted', order='1')
+resolution.create(name='duplicate', order='2')
+resolution.create(name='fixed', order='3')
+resolution.create(name='invalid', order='4')
+resolution.create(name='later', order='5')
+resolution.create(name='out of date', order='6')
+resolution.create(name='postponed', order='7')
+resolution.create(name='rejected', order='8')
+resolution.create(name='remind', order='9')
+resolution.create(name='wont fix', order='10')
+resolution.create(name='works for me', order='11')
 
 #
 # create the two default users


More information about the Python-checkins mailing list