fixes
authormadcoder <madcoder>
Mon, 19 Jun 2006 22:08:24 +0000 (22:08 +0000)
committermadcoder <madcoder>
Mon, 19 Jun 2006 22:08:24 +0000 (22:08 +0000)
remote/bugzilla.py

index dac0bddabdfb82f8e17e73ba7068dbf8c8ac1567..bd0bcff05bcf9acb0815a6886b8202fe9d5747ac 100644 (file)
@@ -36,8 +36,8 @@ from BeautifulSoup import BeautifulSoup
 class OldBugzillaData:
     dupre = re.compile(r'\*\*\* This (?:bug|issue) has been marked as a duplicate of(?: bug)? ([0-9]+) \*\*\*$')
 
-    def __init__(self, s):
-        soup = BeautifulSoup(s)
+    def __init__(self, uri):
+        soup = BeautifulSoup(wget(uri))
 
         if soup.bugzilla:
             bug         = soup.bugzilla.bug     or failwith(uri, "BugZilla: no bug")
@@ -69,8 +69,8 @@ class BugzillaData:
 
     def __init__(self, bug):
 
-        self.id     = bug.bug_id.string     or failwith(uri, "BugZilla: no bug_id")
-        self.status = bug.bug_status.string or failwith(uri, "BugZilla: no bug_status")
+        self.id     = bug.bug_id.string     or failwith("?", "BugZilla: no bug_id")
+        self.status = bug.bug_status.string or failwith(self.id, "BugZilla: no bug_status")
 
         self.resolution = (bug.resolution and bug.resolution.string) or None
         self.duplicate  = None
@@ -88,7 +88,7 @@ class BugzillaData:
                     break
 
             if not self.duplicate:
-                failwith(uri, "BugZilla: cannot find duplicate")
+                failwith(self.id, "BugZilla: cannot find duplicate")
 
 class OldRemoteBugzilla(RemoteBts):
     def __init__(self, cnf):
@@ -121,10 +121,10 @@ class OldRemoteBugzilla(RemoteBts):
         if not id: return None
 
         uri  = "%s/xml.cgi?id=%s" % (self._cnf['uri'], id)
-        data = OldBugzillaData(wget(uri))
+        data = OldBugzillaData(uri)
         while data.resolution == 'DUPLICATE':
             uri  = "%s/xml.cgi?id=%s" % (self._cnf['uri'], data.duplicate)
-            data = OldBugzillaData(wget(uri))
+            data = OldBugzillaData(uri)
 
         return data