~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/check-newsbugs.py

  • Committer: John Arbash Meinel
  • Date: 2009-09-22 02:18:24 UTC
  • mto: This revision was merged to the branch mainline in revision 4709.
  • Revision ID: john@arbash-meinel.com-20090922021824-j3en52uqoof7ym89
Remove some assert statements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
import getopt, re, sys
6
6
try:
7
 
    from launchpadlib.launchpad import Launchpad
 
7
    from launchpadbugs import connector
8
8
except ImportError:
9
 
    print "Please install launchpadlib from lp:launchpadlib"
 
9
    print "Please install launchpadbugs from lp:python-launchpad-bugs"
10
10
    sys.exit(1)
11
11
 
12
12
options, args = getopt.gnu_getopt(sys.argv, "l", ["launchpad"])
22
22
 
23
23
def report_notmarked(bug, task, section):
24
24
    print 
25
 
    print "Bug %d was mentioned in NEWS but is not marked fix released:" % (bug.id, )
 
25
    print "Bug %d was mentioned in NEWS but is not marked fix released:" % (bug.bugnumber, )
26
26
    print "Launchpad title: %s" % bug.title
27
27
    print "NEWS summary: "
28
28
    print section
29
29
    if "--launchpad" in options or "-l" in options:
30
 
        print "  bug %d" % bug.id
31
 
        print "  affects %s" % task.bug_target_name
 
30
        print "  bug %d" % bug.bugnumber
 
31
        print "  affects bzr"
32
32
        print "  status fixreleased"
33
33
 
34
34
 
60
60
    finally:
61
61
        f.close()
62
62
 
63
 
 
64
 
lp = Launchpad.login_anonymously('bzr-check-newsbugs', 'edge', version='1.0')
 
63
open_bug = connector.ConnectBug("TEXT")
65
64
 
66
65
bugnos = read_news_bugnos(args[1])
67
66
for bugno, section in bugnos:
68
 
    bug = lp.bugs[bugno]
 
67
    bug = open_bug(url="https://bugs.launchpad.net/bzr/+bug/%d" % bugno)
69
68
    found_bzr = False
70
 
    for task in bug.bug_tasks:
71
 
        if task.bug_target_name == "bzr":
 
69
    for task in bug.infotable:
 
70
        if task.affects == "bzr":
72
71
            found_bzr = True
73
72
            if task.status != "Fix Released":
74
73
                report_notmarked(bug, task, section)