~ubuntu-branches/debian/sid/ubuntu-dev-tools/sid

« back to all changes in this revision

Viewing changes to lp-list-bugs

  • Committer: Package Import Robot
  • Author(s): Benjamin Drung, Colin Watson, Jelmer Vernooij, Stefano Rivera, Julian Taylor, Benjamin Drung
  • Date: 2011-09-06 14:31:31 UTC
  • Revision ID: package-import@ubuntu.com-20110906143131-pukbbowpabmw4w42
Tags: 0.129
[ Colin Watson ]
* syncpackage: Convert to new LP API, with --no-lp available for the old
  style of operation.
* syncpackage: Require -f/--force option to overwrite Ubuntu changes.

[ Jelmer Vernooij ]
* Remove several tools not specific to Ubuntu that have been migrated to
  lptools (LP: #708886):
 - get-branches (renamed to lp-get-branches)
 - grab-attachments (renamed to lp-grab-attachments)
 - lp-project-upload
 - lp-list-bugs
 - lp-set-dup
 - lp-shell

[ Stefano Rivera ]
* syncpackage: Show changes to be synced when performing native syncs.
* syncpackage: Check the sync blacklist.
* syncpackage: Support --bug (extra bugs to be closed by the sync) with
  native syncs. (Bugs are closed one individually, via the API, post-sync)
* dgetlp, submittodebian, 404main: Use unicode strings for literal strings
  containing non-ASCII characters (LP: #836661)
* Recommend pbuilder | aptitude for get-build-deps, and exit with an error
  if neither are installed (LP: #799368)
* get-build-deps: Tell aptitude not to follow Recommends (LP: #817500)
* doc/requestsync.1: Document the -C option (LP: #833408)
* ubuntutools.archive: Don't write .dsc files until we pull the entire
  source package, just hold it in memory. Avoids littering the current
  directory (LP: #838361)
* Run harvest as part of sponsor-patch (LP: #833699)

[ Julian Taylor ]
* requestsync: omit dups when checking for duplicate requests (LP: #842217)

[ Benjamin Drung ]
* sponsor-patch: Default to not upload the package.
* requestsync: Do not crash on user abort (Closes: #637168).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/python
2
 
# -*- coding: UTF-8 -*-
3
 
"""Briefly list status of Launchpad bugs."""
4
 
 
5
 
# Copyright (c) 2010 Canonical Ltd.
6
 
#
7
 
# lp-set-dup is free software; you can redistribute it and/or modify it
8
 
# under the terms of the GNU General Public License as published by the
9
 
# Free Software Foundation; either version 3, or (at your option) any
10
 
# later version.
11
 
#
12
 
# lp-set-dup is distributed in the hope that it will be useful, but
13
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 
# General Public License for more details.
16
 
#
17
 
# You should have received a copy of the GNU General Public License
18
 
# along with lp-set-dup; see the file COPYING.  If not, write to the Free
19
 
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20
 
# 02110-1301, USA.
21
 
#
22
 
# Authors:
23
 
#  Colin Watson <cjwatson@ubuntu.com>
24
 
 
25
 
import sys
26
 
from optparse import OptionParser
27
 
 
28
 
from launchpadlib.launchpad import Launchpad
29
 
from launchpadlib.errors import HTTPError
30
 
 
31
 
def main():
32
 
    usage = "Usage: %prog <bug> [...]"
33
 
    parser = OptionParser(usage)
34
 
    args = parser.parse_args()[1]
35
 
    if len(args) < 1:
36
 
        parser.error("Need at least one bug number")
37
 
 
38
 
    try:
39
 
        launchpad = Launchpad.login_with('ubuntu-dev-tools', 'production')
40
 
    except Exception, error:
41
 
        print >> sys.stderr, 'Could not connect to Launchpad:', str(error)
42
 
        sys.exit(2)
43
 
 
44
 
    for bugnum in args:
45
 
        try:
46
 
            bug = launchpad.bugs[bugnum]
47
 
            print "Bug %s: %s" % (bugnum, bug.title)
48
 
            for task in bug.bug_tasks:
49
 
                print "  %s: %s" % (task.bug_target_name, task.status)
50
 
        except HTTPError, error:
51
 
            if error.response.status == 401:
52
 
                print >> sys.stderr, \
53
 
                    ("E: Don't have enough permissions to access bug %s" %
54
 
                     bugnum)
55
 
                print >> sys.stderr, error.content
56
 
                continue
57
 
            elif error.response.status == 404:
58
 
                print >> sys.stderr, "E: Bug %s not found" % bugnum
59
 
            else:
60
 
                raise
61
 
 
62
 
if __name__ == '__main__':
63
 
    main()