Rev 5275: (Jelmer) Use launchpadlib rather than launchpadbugs in in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Jun 1 22:28:23 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5275 [merge]
revision-id: pqm at pqm.ubuntu.com-20100601212820-0h5modtetq6efk90
parent: pqm at pqm.ubuntu.com-20100531213846-hsswwpgkhe8toq8t
parent: jelmer at samba.org-20100601164647-3vi5gvidly5aql3m
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2010-06-01 22:28:20 +0100
message:
  (Jelmer) Use launchpadlib rather than launchpadbugs in
  	check-newsbugs.py.
modified:
  tools/check-newsbugs.py        checknewsbugs.py-20090128204947-lsdwd8nlswm1yrwv-1
=== modified file 'tools/check-newsbugs.py'
--- a/tools/check-newsbugs.py	2009-01-30 16:55:33 +0000
+++ b/tools/check-newsbugs.py	2010-06-01 16:46:47 +0000
@@ -4,9 +4,9 @@
 
 import getopt, re, sys
 try:
-    from launchpadbugs import connector
+    from launchpadlib.launchpad import Launchpad
 except ImportError:
-    print "Please install launchpadbugs from lp:python-launchpad-bugs"
+    print "Please install launchpadlib from lp:launchpadlib"
     sys.exit(1)
 
 options, args = getopt.gnu_getopt(sys.argv, "l", ["launchpad"])
@@ -22,13 +22,13 @@
 
 def report_notmarked(bug, task, section):
     print 
-    print "Bug %d was mentioned in NEWS but is not marked fix released:" % (bug.bugnumber, )
+    print "Bug %d was mentioned in NEWS but is not marked fix released:" % (bug.id, )
     print "Launchpad title: %s" % bug.title
     print "NEWS summary: "
     print section
     if "--launchpad" in options or "-l" in options:
-        print "  bug %d" % bug.bugnumber
-        print "  affects bzr"
+        print "  bug %d" % bug.id
+        print "  affects %s" % task.bug_target_name
         print "  status fixreleased"
 
 
@@ -60,14 +60,15 @@
     finally:
         f.close()
 
-open_bug = connector.ConnectBug("TEXT")
+
+lp = Launchpad.login_anonymously('bzr-check-newsbugs', 'edge', version='1.0')
 
 bugnos = read_news_bugnos(args[1])
 for bugno, section in bugnos:
-    bug = open_bug(url="https://bugs.launchpad.net/bzr/+bug/%d" % bugno)
+    bug = lp.bugs[bugno]
     found_bzr = False
-    for task in bug.infotable:
-        if task.affects == "bzr":
+    for task in bug.bug_tasks:
+        if task.bug_target_name == "bzr":
             found_bzr = True
             if task.status != "Fix Released":
                 report_notmarked(bug, task, section)




More information about the bazaar-commits mailing list