Merge lp:~jelmer/bzr/lplib into lp:bzr

Proposed by Jelmer Vernooij
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: 5275
Proposed branch: lp:~jelmer/bzr/lplib
Merge into: lp:bzr
Diff against target: 52 lines (+10/-9)
1 file modified
tools/check-newsbugs.py (+10/-9)
To merge this branch: bzr merge lp:~jelmer/bzr/lplib
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+26517@code.launchpad.net

Commit message

This converts check-newsbugs.py to use launchpadlib rather than using the old and deprecated (screen-scraping) launchpadbugs python package.

Description of the change

This converts check-newsbugs.py to use launchpadlib rather than using the old and deprecated (screen-scraping) launchpadbugs python package.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jelmer Vernooij wrote:
> Jelmer Vernooij has proposed merging lp:~jelmer/bzr/lplib into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
> Related bugs:
> #354985 check-newsbugs.py LaunchpadLoginError; should be ported to launchpadlib
> https://bugs.launchpad.net/bugs/354985
>
>
> This converts check-newsbugs.py to use launchpadlib rather than using the old and deprecated (screen-scraping) launchpadbugs python package.
>

 merge: approve

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwFZLcACgkQJdeBCYSNAAPSpgCgiDXN1cdPJgF+tnVD3fEVQv8f
xV8AoKwGNROQBgRacVCbh6GfTbstfcYv
=fGWX
-----END PGP SIGNATURE-----

review: Approve
Revision history for this message
Robert Collins (lifeless) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tools/check-newsbugs.py'
--- tools/check-newsbugs.py 2009-01-30 16:55:33 +0000
+++ tools/check-newsbugs.py 2010-06-01 16:48:31 +0000
@@ -4,9 +4,9 @@
44
5import getopt, re, sys5import getopt, re, sys
6try:6try:
7 from launchpadbugs import connector7 from launchpadlib.launchpad import Launchpad
8except ImportError:8except ImportError:
9 print "Please install launchpadbugs from lp:python-launchpad-bugs"9 print "Please install launchpadlib from lp:launchpadlib"
10 sys.exit(1)10 sys.exit(1)
1111
12options, args = getopt.gnu_getopt(sys.argv, "l", ["launchpad"])12options, args = getopt.gnu_getopt(sys.argv, "l", ["launchpad"])
@@ -22,13 +22,13 @@
2222
23def report_notmarked(bug, task, section):23def report_notmarked(bug, task, section):
24 print 24 print
25 print "Bug %d was mentioned in NEWS but is not marked fix released:" % (bug.bugnumber, )25 print "Bug %d was mentioned in NEWS but is not marked fix released:" % (bug.id, )
26 print "Launchpad title: %s" % bug.title26 print "Launchpad title: %s" % bug.title
27 print "NEWS summary: "27 print "NEWS summary: "
28 print section28 print section
29 if "--launchpad" in options or "-l" in options:29 if "--launchpad" in options or "-l" in options:
30 print " bug %d" % bug.bugnumber30 print " bug %d" % bug.id
31 print " affects bzr"31 print " affects %s" % task.bug_target_name
32 print " status fixreleased"32 print " status fixreleased"
3333
3434
@@ -60,14 +60,15 @@
60 finally:60 finally:
61 f.close()61 f.close()
6262
63open_bug = connector.ConnectBug("TEXT")63
64lp = Launchpad.login_anonymously('bzr-check-newsbugs', 'edge', version='1.0')
6465
65bugnos = read_news_bugnos(args[1])66bugnos = read_news_bugnos(args[1])
66for bugno, section in bugnos:67for bugno, section in bugnos:
67 bug = open_bug(url="https://bugs.launchpad.net/bzr/+bug/%d" % bugno)68 bug = lp.bugs[bugno]
68 found_bzr = False69 found_bzr = False
69 for task in bug.infotable:70 for task in bug.bug_tasks:
70 if task.affects == "bzr":71 if task.bug_target_name == "bzr":
71 found_bzr = True72 found_bzr = True
72 if task.status != "Fix Released":73 if task.status != "Fix Released":
73 report_notmarked(bug, task, section)74 report_notmarked(bug, task, section)