Commits

illume committed 9a4e6c6

extract a set of tags which are used in the bugs.
This will aid in writing a conversion map.

  • Participants
  • Parent commits caf3dd1

Comments (0)

Files changed (1)

File create_issues.py

 	    kind: The kind of issue (bug, enhancement, or proposal).
 
 How to delete an issue:
-	curl X DELETE https://api.bitbucket.org/1.0/repositories/pygame/pygame/issues/3
+	curl -X DELETE https://api.bitbucket.org/1.0/repositories/pygame/pygame/issues/3
 
 Add --user username:password afterwards to authenticate, otherwise it does not work.
 
     for f in files:
 
         tree = ElementTree.parse(f)
-        root = tree.getroot()
-        xmldict = XmlDictConfig(root)
-        #pprint.pprint( xmldict )
+        xmldict = XmlDictConfig(tree.getroot())
+
+        # create a list of long_desc since the xml2dict func does not work correctly here.
         xmldict['bug']['long_desc'] = []
-
-        root = tree.getroot()
-        for x in root.getiterator():
+        for x in tree.getroot().getiterator():
             if x.tag == 'long_desc':
                 xmldict['bug']['long_desc'].append(XmlDictConfig(x))
 
 
         bugs[xmldict['bug']['bug_id']] = xmldict['bug']
 
-    #pprint.pprint( bugs['3'] )
     return bugs
 
 
+
+
+def extractInfo(bugs):
+    info = dict(bug_status = set([]), 
+                version = set([]), 
+                component= set([]), 
+                product= set([]), 
+                op_sys= set([]), 
+                rep_platform= set([]), 
+                priority= set([]), 
+                bug_severity= set([]), 
+                target_milestone= set([])
+                )
+    for bug_id, b in bugs.items():
+        for k in info.keys():
+            if k in b:
+                info[k].add(b[k])
+
+    return info
+
+def convertBug(bug):
+    """ converts a bugzilla bug into a bitbucket issue.
+    """
+    i = dict(title="just a test issue", 
+             content="some content to test", 
+             component="pygameissues", 
+             milestone="bitbucketmigration", 
+             version="1.9.2", 
+             responsible="illume", 
+             status="new", 
+             kind="bug")
+
+
+
+
+
 bugs = create_bugzilla_dicts()
+#pprint.pprint( bugs['3'] )
 
-
-
-
+info = extractInfo(bugs)
+pprint.pprint(info)