[Python-checkins] r52982 - in tracker: importer/sfxmlhandlers.py instances/python-dev/initial_data.py

erik.forsberg python-checkins at python.org
Sun Dec 10 10:50:17 CET 2006


Author: erik.forsberg
Date: Sun Dec 10 10:49:59 2006
New Revision: 52982

Modified:
   tracker/importer/sfxmlhandlers.py
   tracker/instances/python-dev/initial_data.py
Log:

* Merge duplicate categories from sf.net into Components using a
  simple mapping.

* Don't add any Components in initial_data, they're added on the fly
  by the importer.


Modified: tracker/importer/sfxmlhandlers.py
==============================================================================
--- tracker/importer/sfxmlhandlers.py	(original)
+++ tracker/importer/sfxmlhandlers.py	Sun Dec 10 10:49:59 2006
@@ -220,12 +220,20 @@
 class ComponentHandler(SFXMLHandler):
     def handle(self, fields, roundupdata):
         # Note: We might want to merge some components into one later.
+        categorymerge = {"Demos and tools":"Demos and Tools",
+                         "Distutils and setup.py":"Distutils",
+                         "Python Interpreter Core":"Interpreter Core",
+                         "Core (C code)":"Interpreter Core",
+                         "Python Library":"Library (Lib)",
+                         "Modules":"Extension Modules"}
+        category = categorymerge.get(fields[self.source].text,
+                                     fields[self.source].text)
         try:
-            component_id = self.db.component.lookup(fields[self.source].text)
+            component_id = self.db.component.lookup(category)
             roundupdata[self.target] =  [component_id]
         except KeyError:
             roundupdata[self.target] = \
-                    [self.db.component.create(name=fields[self.source].text)]
+                    [self.db.component.create(name=category)]
 
 class NosyHandler(SFXMLHandler, UserMixin):
     def handle(self, fields, roundupdata):

Modified: tracker/instances/python-dev/initial_data.py
==============================================================================
--- tracker/instances/python-dev/initial_data.py	(original)
+++ tracker/instances/python-dev/initial_data.py	Sun Dec 10 10:49:59 2006
@@ -12,11 +12,6 @@
 issue_type.create(name='behavior', order='5')
 issue_type.create(name='rfe', order='6')
 
-component = db.getclass('component')
-component.create(name='core', order='1')
-component.create(name='distutils', order='2')
-component.create(name='stdlib', order='3')
-
 version = db.getclass('version')
 version.create(name='2.5', order='1')
 version.create(name='3k', order='2')


More information about the Python-checkins mailing list