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

Proposed by Jelmer Vernooij on 2010-06-01
Status: Merged
Approved by: John A Meinel on 2010-06-01
Approved revision: 5275
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 2010-06-01 Approve on 2010-06-01
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.
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
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
1=== modified file 'tools/check-newsbugs.py'
2--- tools/check-newsbugs.py 2009-01-30 16:55:33 +0000
3+++ tools/check-newsbugs.py 2010-06-01 16:48:31 +0000
4@@ -4,9 +4,9 @@
5
6 import getopt, re, sys
7 try:
8- from launchpadbugs import connector
9+ from launchpadlib.launchpad import Launchpad
10 except ImportError:
11- print "Please install launchpadbugs from lp:python-launchpad-bugs"
12+ print "Please install launchpadlib from lp:launchpadlib"
13 sys.exit(1)
14
15 options, args = getopt.gnu_getopt(sys.argv, "l", ["launchpad"])
16@@ -22,13 +22,13 @@
17
18 def report_notmarked(bug, task, section):
19 print
20- print "Bug %d was mentioned in NEWS but is not marked fix released:" % (bug.bugnumber, )
21+ print "Bug %d was mentioned in NEWS but is not marked fix released:" % (bug.id, )
22 print "Launchpad title: %s" % bug.title
23 print "NEWS summary: "
24 print section
25 if "--launchpad" in options or "-l" in options:
26- print " bug %d" % bug.bugnumber
27- print " affects bzr"
28+ print " bug %d" % bug.id
29+ print " affects %s" % task.bug_target_name
30 print " status fixreleased"
31
32
33@@ -60,14 +60,15 @@
34 finally:
35 f.close()
36
37-open_bug = connector.ConnectBug("TEXT")
38+
39+lp = Launchpad.login_anonymously('bzr-check-newsbugs', 'edge', version='1.0')
40
41 bugnos = read_news_bugnos(args[1])
42 for bugno, section in bugnos:
43- bug = open_bug(url="https://bugs.launchpad.net/bzr/+bug/%d" % bugno)
44+ bug = lp.bugs[bugno]
45 found_bzr = False
46- for task in bug.infotable:
47- if task.affects == "bzr":
48+ for task in bug.bug_tasks:
49+ if task.bug_target_name == "bzr":
50 found_bzr = True
51 if task.status != "Fix Released":
52 report_notmarked(bug, task, section)