Merge lp:~jelmer/ubuntu-dev-tools/lptools-migration into lp:~ubuntu-dev/ubuntu-dev-tools/trunk

Proposed by Jelmer Vernooij
Status: Merged
Merged at revision: 1123
Proposed branch: lp:~jelmer/ubuntu-dev-tools/lptools-migration
Merge into: lp:~ubuntu-dev/ubuntu-dev-tools/trunk
Diff against target: 1227 lines (+30/-1005)
18 files modified
debian/NEWS (+18/-0)
debian/changelog (+12/-1)
debian/control (+0/-7)
debian/copyright (+0/-14)
doc/get-branches.1 (+0/-47)
doc/grab-attachments.1 (+0/-57)
doc/lp-list-bugs.1 (+0/-27)
doc/lp-project-upload.1 (+0/-24)
doc/lp-set-dup.1 (+0/-56)
doc/lp-shell.1 (+0/-52)
get-branches (+0/-118)
grab-attachments (+0/-107)
lp-list-bugs (+0/-63)
lp-project-upload (+0/-178)
lp-set-dup (+0/-134)
lp-shell (+0/-112)
setup.py (+0/-6)
ubuntutools/test/test_help.py (+0/-2)
To merge this branch: bzr merge lp:~jelmer/ubuntu-dev-tools/lptools-migration
Reviewer Review Type Date Requested Status
Stefano Rivera Approve
Review via email: mp+71847@code.launchpad.net

Description of the change

Remove lp-set-dup, lp-list-bugs and lp-project-upload, which have been migrated to lptools.

To post a comment you must log in.
Revision history for this message
Stefano Rivera (stefanor) wrote :

Please also update the package description, debian/copyright, and
ubuntutools/test/test_help.py. And remove the manpages.

1121. By Jelmer Vernooij

Also remove manual pages, entries in copyright.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

> Please also update the package description, debian/copyright, and
> ubuntutools/test/test_help.py. And remove the manpages.
Good point. I've updated the branch.

1122. By Jelmer Vernooij

Update test-help

Revision history for this message
Stefano Rivera (stefanor) wrote :

I'm happy. Are you going to add a Breaks+Replaces in lptools?

review: Approve
Revision history for this message
Benjamin Drung (bdrung) wrote :

Before we can merge this branch, we need to be assured that lptools will be upload to Debian.

Please refer to bug #708886.

Shouldn't get-branches, grab-attachments, and lp-shell moved to lptools too?

Revision history for this message
Benjamin Drung (bdrung) wrote :

You added lptools to Recommends. Are there any tools in ubuntu-dev-tools that use one of the three scripts? Otherwise I think we should drop it and add lptools to packaging-dev instead.

Revision history for this message
Stefano Rivera (stefanor) wrote :

Benjamin: Good catch, re getting lptools into Debian.

No, nothing else in u-d-t uses these scripts

Revision history for this message
Benjamin Drung (bdrung) wrote :

Jelmer answered:
> I added it mainly to make the upgrade smoother for people who have
> ubuntu-dev-tools installed at the moment and use lp-set-dup,
> lp-list-bugs or lp-upload-project.

> Adding it as a recommends for packaging-dev works for me too. Just let
> me know which one you prefer.

I prefer dropping lptools from u-d-t Recommends and add it to packaging-dev. Other thoughts?

Revision history for this message
Stefano Rivera (stefanor) wrote :

I think lptools should probably be in Debian (as a Debian user, I'd appreciate it).

And I agree with the packaging-dev solution to this problem.

1123. By Jelmer Vernooij

remove grab-attachments, too.

1124. By Jelmer Vernooij

Remove lp-shell, too.

1125. By Jelmer Vernooij

get-branches is in lptools now, too.

1126. By Jelmer Vernooij

merge trunk.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I've got a lptools upload ready for Debian, but I'm not sure what version of ubuntu-dev-tools to use in Breaks/Replaces yet. Would 0.129 be a safe bet?

Revision history for this message
Benjamin Drung (bdrung) wrote :

0.129 will be a safe bet. I am going to merge this branch.

Can you drop lptools from Recommends?

Can you document in the changelog which tools where renamed?

Maybe a NEWS file entry would be useful.

Can you check if some names can be removed in the d/copyright file?

1127. By Jelmer Vernooij

Update changelog.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

> 0.129 will be a safe bet. I am going to merge this branch.
>
> Can you drop lptools from Recommends?
Done.

> Can you document in the changelog which tools where renamed?
Done.

> Maybe a NEWS file entry would be useful.
Done.

> Can you check if some names can be removed in the d/copyright file?
As far as I can tell Dustin is the only one who no longer has copyright on any of the ubuntu-dev-tools; updated copyright accordingly.

I've uploaded a new lptools (with Breaks/Replaces for ubuntu-dev-tools << 0.129) to sid.

1128. By Jelmer Vernooij

Drop lptools from recommends.

1129. By Jelmer Vernooij

NEWS entry.

1130. By Jelmer Vernooij

Update copyright file.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/NEWS'
--- debian/NEWS 2011-03-01 13:03:32 +0000
+++ debian/NEWS 2011-09-02 11:53:47 +0000
@@ -1,3 +1,21 @@
1ubuntu-dev-tools (0.129) unstable; urgency=low
2
3 Several tools that worked against Launchpad but were not specific to Ubuntu
4 have been migrated to the "lptools" project.
5
6 The following tools have moved:
7 - get-branches (renamed to lp-get-branches)
8 - grab-attachments (renamed to lp-grab-attachments)
9 - lp-project-upload
10 - lp-list-bugs
11 - lp-set-dup
12 - lp-shell
13
14 They can now be found in the lptools package (version 0.0.1~bzr28-1 or
15 later).
16
17 -- Jelmer Vernooij <jelmer@debian.org> Fri, 02 Sep 2011 13:43:34 +0200
18
1ubuntu-dev-tools (0.119) unstable; urgency=low19ubuntu-dev-tools (0.119) unstable; urgency=low
220
3 launchpadlib 1.9 will cause some issues, as it uses the GNOME Keyring / KDE21 launchpadlib 1.9 will cause some issues, as it uses the GNOME Keyring / KDE
422
=== modified file 'debian/changelog'
--- debian/changelog 2011-08-16 18:56:38 +0000
+++ debian/changelog 2011-09-02 11:53:47 +0000
@@ -1,10 +1,21 @@
1ubuntu-dev-tools (0.129) UNRELEASED; urgency=low1ubuntu-dev-tools (0.129) UNRELEASED; urgency=low
22
3 [ Colin Watson ]
3 * syncpackage: Convert to new LP API, with --no-lp available for the old4 * syncpackage: Convert to new LP API, with --no-lp available for the old
4 style of operation.5 style of operation.
5 * syncpackage: Require -f/--force option to overwrite Ubuntu changes.6 * syncpackage: Require -f/--force option to overwrite Ubuntu changes.
67
7 -- Colin Watson <cjwatson@ubuntu.com> Tue, 16 Aug 2011 16:40:22 +01008 [ Jelmer Vernooij ]
9 * Remove several tools not specific to Ubuntu that have been migrated to
10 lptools (LP: #708886):
11 - get-branches (renamed to lp-get-branches)
12 - grab-attachments (renamed to lp-grab-attachments)
13 - lp-project-upload
14 - lp-list-bugs
15 - lp-set-dup
16 - lp-shell
17
18 -- Jelmer Vernooij <jelmer@debian.org> Thu, 01 Sep 2011 19:38:53 +0200
819
9ubuntu-dev-tools (0.128) unstable; urgency=low20ubuntu-dev-tools (0.128) unstable; urgency=low
1021
1122
=== modified file 'debian/control'
--- debian/control 2011-08-14 15:07:42 +0000
+++ debian/control 2011-09-02 11:53:47 +0000
@@ -75,21 +75,14 @@
75 - debian-distro-info - provides information about Debian's distributions.75 - debian-distro-info - provides information about Debian's distributions.
76 - dgetlp - download a source package from the Launchpad library.76 - dgetlp - download a source package from the Launchpad library.
77 - distro-info - provides information about the distributions' releases.77 - distro-info - provides information about the distributions' releases.
78 - get-branches - used to branch/checkout all the bzr branches in a Launchpad
79 team.
80 - get-build-deps - install the build dependencies needed for a package78 - get-build-deps - install the build dependencies needed for a package
81 reading debian/control.79 reading debian/control.
82 - grab-attachments - download all bug attachments from a Launchpad bug
83 report.
84 - grab-merge - grabs a merge from merges.ubuntu.com easily.80 - grab-merge - grabs a merge from merges.ubuntu.com easily.
85 - grep-merges - search for pending merges from Debian.81 - grep-merges - search for pending merges from Debian.
86 - harvest - grabs information about development opportunities from82 - harvest - grabs information about development opportunities from
87 http://harvest.ubuntu.com83 http://harvest.ubuntu.com
88 - hugdaylist - compile HugDay lists from bug list URLs.84 - hugdaylist - compile HugDay lists from bug list URLs.
89 - import-bug-from-debian - copy a bug from the Debian BTS to Launchpad85 - import-bug-from-debian - copy a bug from the Debian BTS to Launchpad
90 - lp-list-bugs - briefly list status of Launchpad bugs.
91 - lp-project-upload - upload a release tarball to a Launchpad project
92 - lp-set-dup - sets the "duplicate of" bug of a bug and its dups.
93 - massfile - fill multiple bugs using a template.86 - massfile - fill multiple bugs using a template.
94 - merge-changelog - manually merges two Debian changelogs with the same base87 - merge-changelog - manually merges two Debian changelogs with the same base
95 version.88 version.
9689
=== modified file 'debian/copyright'
--- debian/copyright 2011-06-25 15:53:44 +0000
+++ debian/copyright 2011-09-02 11:53:47 +0000
@@ -11,7 +11,6 @@
11 doc/check-symbols.111 doc/check-symbols.1
12 doc/requestsync.112 doc/requestsync.1
13 doc/ubuntu-iso.113 doc/ubuntu-iso.1
14 lp-shell
15 requestsync14 requestsync
16 setup.py15 setup.py
17 ubuntu-iso16 ubuntu-iso
@@ -22,7 +21,6 @@
22 2010, Benjamin Drung <bdrung@ubuntu.com>21 2010, Benjamin Drung <bdrung@ubuntu.com>
23 2007-2010, Canonical Ltd.22 2007-2010, Canonical Ltd.
24 2006-2007, Daniel Holbach <daniel.holbach@ubuntu.com>23 2006-2007, Daniel Holbach <daniel.holbach@ubuntu.com>
25 2010, Dustin Kirkland <kirkland@ubuntu.com>
26 2010, Evan Broder <evan@ebroder.net>24 2010, Evan Broder <evan@ebroder.net>
27 2006-2007, Luke Yelavich <themuso@ubuntu.com>25 2006-2007, Luke Yelavich <themuso@ubuntu.com>
28 2009-2010, Michael Bienia <geser@ubuntu.com>26 2009-2010, Michael Bienia <geser@ubuntu.com>
@@ -47,16 +45,11 @@
47 doc/404main.145 doc/404main.1
48 doc/dgetlp.146 doc/dgetlp.1
49 doc/import-bug-from-debian.147 doc/import-bug-from-debian.1
50 doc/lp-project-upload.1
51 doc/lp-set-dup.1
52 doc/lp-shell.1
53 doc/pbuilder-dist-simple.148 doc/pbuilder-dist-simple.1
54 doc/pbuilder-dist.149 doc/pbuilder-dist.1
55 doc/reverse-build-depends.150 doc/reverse-build-depends.1
56 doc/submittodebian.151 doc/submittodebian.1
57 import-bug-from-debian52 import-bug-from-debian
58 lp-project-upload
59 lp-set-dup
60 pbuilder-dist53 pbuilder-dist
61 pbuilder-dist-simple54 pbuilder-dist-simple
62 reverse-build-depends55 reverse-build-depends
@@ -87,8 +80,6 @@
8780
88Files: ack-sync81Files: ack-sync
89 doc/bitesize.182 doc/bitesize.1
90 doc/get-branches.1
91 doc/grab-attachments.1
92 doc/grab-merge.183 doc/grab-merge.1
93 doc/harvest.184 doc/harvest.1
94 doc/hugdaylist.185 doc/hugdaylist.1
@@ -97,8 +88,6 @@
97 doc/setup-packaging-environment.188 doc/setup-packaging-environment.1
98 doc/syncpackage.189 doc/syncpackage.1
99 bitesize90 bitesize
100 get-branches
101 grab-attachments
102 grab-merge91 grab-merge
103 harvest92 harvest
104 hugdaylist93 hugdaylist
@@ -108,7 +97,6 @@
108 syncpackage97 syncpackage
109Copyright: 2010, Benjamin Drung <bdrung@ubuntu.com>98Copyright: 2010, Benjamin Drung <bdrung@ubuntu.com>
110 2007-2011, Canonical Ltd.99 2007-2011, Canonical Ltd.
111 2010, Dustin Kirkland <kirkland@ubuntu.com>
112 2008, Jonathan Patrick Davies <jpds@ubuntu.com>100 2008, Jonathan Patrick Davies <jpds@ubuntu.com>
113 2008-2010, Martin Pitt <martin.pitt@canonical.com>101 2008-2010, Martin Pitt <martin.pitt@canonical.com>
114 2009, Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>102 2009, Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
@@ -130,14 +118,12 @@
130 doc/dch-repeat.1118 doc/dch-repeat.1
131 doc/get-build-deps.1119 doc/get-build-deps.1
132 doc/grep-merges.1120 doc/grep-merges.1
133 doc/lp-list-bugs.1
134 doc/mk-sbuild.1121 doc/mk-sbuild.1
135 doc/pull-lp-source.1122 doc/pull-lp-source.1
136 doc/pull-revu-source.1123 doc/pull-revu-source.1
137 doc/ubuntu-build.1124 doc/ubuntu-build.1
138 get-build-deps125 get-build-deps
139 grep-merges126 grep-merges
140 lp-list-bugs
141 mk-sbuild127 mk-sbuild
142 pull-lp-source128 pull-lp-source
143 pull-revu-source129 pull-revu-source
144130
=== removed file 'doc/get-branches.1'
--- doc/get-branches.1 2010-12-02 23:06:43 +0000
+++ doc/get-branches.1 1970-01-01 00:00:00 +0000
@@ -1,47 +0,0 @@
1.TH get\-branches "1" "11 August 2008" "ubuntu-dev-tools"
2.SH NAME
3get\-branches - downloads all branches related to a Launchpad team or person
4
5.SH SYNOPSIS
6.B get\-branches
7.RB [ \-d
8.IR directory ]
9.RB [ \-o
10.BR branch | checkout ]
11.B \-t
12.I team
13.br
14.B get\-branches
15.I team
16.br
17.B get\-branches \-\-help
18
19.SH DESCRIPTION
20\fBget\-branches\fR uses the LP API to get a list of branches for a person or
21team and calls Bazaar to download all branches.
22
23.SH OPTIONS
24Listed below are the command line options for \fBget\-branches\fR:
25.TP
26.BR \-h ", " \-\-help
27Display a help message and exit.
28.TP
29.BR \-d ", " \-\-directory
30Download branches to a directory other than the current directory.
31.TP
32.BR \-o ", " \-\-operation
33Specifies which Bazaar operation to use when downloading the branches; may be
34either \fIbranch\fR or \fIcheckout\fR.
35.TP
36.BR \-t ", " \-\-team
37Specifies which Launchpad team/person to download branches from.
38This option is required.
39
40.SH AUTHORS
41\fBget\-branches\fR was written by Daniel Holbach <daniel.holbach@ubuntu.com>,
42and this manual page was written by Jonathan Patrick Davies <jpds@ubuntu.com>.
43.PP
44Both are released under the terms of the GNU General Public License, version 3.
45
46.SH SEE ALSO
47.B bzr(1)
480
=== removed file 'doc/grab-attachments.1'
--- doc/grab-attachments.1 2011-06-16 19:02:04 +0000
+++ doc/grab-attachments.1 1970-01-01 00:00:00 +0000
@@ -1,57 +0,0 @@
1.TH GRAB\-ATTACHMENTS "1" "10 August 2008" "ubuntu-dev-tools"
2.SH NAME
3grab\-attachments \- downloads attachments from a Launchpad bug
4.SH SYNOPSIS
5.B grab\-attachments\fR [\fIoptions\fR] \fIbug-number\fR...
6.br
7.B grab\-attachments \-h
8.SH DESCRIPTION
9\fBgrab\-attachments\fR is a script to download all attachments from a
10Launchpad bug report or bug reports with a source package task into
11a directory named after the bug e.g. bug-1.
12
13.SH OPTIONS
14Listed below are the command line options for grab\-attachments:
15.TP
16.I bug-number
17Specifies the Launchpad bug number that the script should download
18attachments from.
19.TP
20.BR \-h ", " \-\-help
21Display a help message and exit.
22.TP
23.B \-l \fIINSTANCE\fR, \fB\-\-lpinstance\fR=\fIINSTANCE\fR
24Use the specified instance of Launchpad (e.g. "staging"), instead of
25the default of "production".
26.TP
27.B \-\-no\-conf
28Do not read any configuration files, or configuration from environment
29variables.
30.TP
31.BR \-d ", " \-\-duplicates
32Download attachments from duplicates too.
33.TP
34.B \-p \fISRCPACKAGE\fR, \fB\-\-package\fR=\fISRCPACKAGE\fR
35Download attachments from all bugs with a task for this source
36package.
37.SH ENVIRONMENT
38All of the \fBCONFIGURATION VARIABLES\fR below are also supported as
39environment variables.
40Variables in the environment take precedence to those in configuration
41files.
42.SH CONFIGURATION VARIABLES
43The following variables can be set in the environment or in
44.BR ubuntu\-dev\-tools (5)
45configuration files.
46In each case, the script\-specific variable takes precedence over the
47package\-wide variable.
48.TP
49.BR GRAB_ATTACHMENTS_LPINSTANCE ", " UBUNTUTOOLS_LPINSTANCE
50The default value for \fB--lpinstance\fR.
51.SH SEE ALSO
52.BR ubuntu\-dev\-tools (5)
53.SH AUTHOR
54\fBgrab\-attachments\fR was written by Daniel Holbach and this manual page
55was written by Jonathan Patrick Davies.
56.PP
57Both are released under the GNU General Public License, version 2.
580
=== removed file 'doc/lp-list-bugs.1'
--- doc/lp-list-bugs.1 2010-09-17 11:45:52 +0000
+++ doc/lp-list-bugs.1 1970-01-01 00:00:00 +0000
@@ -1,27 +0,0 @@
1.TH lp\-list\-bugs 1 2010-09-17 ubuntu-dev-tools
2.SH NAME
3lp\-list\-bugs \- briefly list status of Launchpad bugs
4.SH DESCRIPTION
5.B lp\-list\-bugs
6takes one or more Launchpad bug numbers, and lists the status of each bug in a
7concise format.
8For example:
9.PP
10.RS
11.nf
12$ lp\-list\-bugs 3
13Bug 3: Custom information for each translation team
14 rosetta: Fix Released
15 ubuntu: Invalid
16 mono (Ubuntu): Invalid
17.fi
18.RE
19.SH OPTIONS
20.TP
21.BR \-h ", " \-\-help
22Display a help message and exit.
23.SH AUTHORS
24.B lp\-list\-bugs
25and this manual page were written by Colin Watson <cjwatson@ubuntu.com>.
26Both are released under the terms of the GNU General Public License, version
273 or later.
280
=== removed file 'doc/lp-project-upload.1'
--- doc/lp-project-upload.1 2011-06-02 22:30:20 +0000
+++ doc/lp-project-upload.1 1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@
1.TH lp-project-upload "1" "05 September 2009" "ubuntu-dev-tools"
2.SH NAME
3lp\-project\-upload \- Upload a release tarball to a Launchpad project.
4
5.SH SYNOPSIS
6.B lp\-project\-upload
7.I <project name> <version> <tarball> [new milestone] [changelog file] [releasenotes file]
8
9.SH DESCRIPTION
10\fBlp\-project\-upload\fR uploads a tarball release of a project to Launchpad.
11It can create milestones and releases on the fly after confirmation.
12
13If there is a file \fItarball\fB.asc\fR, it is uploaded as the signature of the
14tarball.
15
16You can optionally provide the name of the next milestone, which will be created if specified.
17
18You can optionally provide filename(s) specifying the changelog and release notes entries for this release. Note that these might be /dev/null, if you do not want to provide changelog or release notes information. If these are not specified, an interactive editor will allow you to compose these.
19
20.SH AUTHORS
21\fBlp\-project\-upload\fR was written by Martin Pitt <martin.pitt@ubuntu.com> and enhanced by Dustin Kirkland <kirkland@ubuntu.com>.
22.PP
23It is released under the terms of the GNU General Public License, version 2
24or (at your option) any later version.
250
=== removed file 'doc/lp-set-dup.1'
--- doc/lp-set-dup.1 2010-12-22 20:57:02 +0000
+++ doc/lp-set-dup.1 1970-01-01 00:00:00 +0000
@@ -1,56 +0,0 @@
1.TH lp\-set\-dup "1" "March 6 2010" "ubuntu-dev-tools"
2.SH NAME
3lp\-set\-dup \- mark one or more bugs as duplicate of another bug
4
5.SH SYNOPSIS
6.B lp\-set\-dup \fR[\fB\-f\fR] <\fImain bug\fR> <\fIduplicate bug\fR>
7[<\fIduplicate bug\fR> ...]
8.br
9.B lp\-set\-dup \-\-help
10
11.SH DESCRIPTION
12\fBlp\-set\-dup\fR allow to easily mark one or more bug as duplicate of
13another bug. It checks for permission to operate on a given bug first,
14then perform required tasks on Launchpad.
15
16.SH OPTIONS
17Listed below are the command line options for \fBlp\-set\-dup\fR:
18.TP
19.BR \-h ", " \-\-help
20Display a help message and exit.
21.TP
22.B \-f
23Skip confirmation prompt.
24.TP
25.B \-l \fIINSTANCE\fR, \fB\-\-lpinstance\fR=\fIINSTANCE\fR
26Use the specified instance of Launchpad (e.g. "staging"), instead of
27the default of "production".
28.TP
29.B \-\-no\-conf
30Do not read any configuration files, or configuration from environment
31variables.
32
33.SH ENVIRONMENT
34All of the \fBCONFIGURATION VARIABLES\fR below are also supported as
35environment variables.
36Variables in the environment take precedence to those in configuration
37files.
38
39.SH CONFIGURATION VARIABLES
40The following variables can be set in the environment or in
41.BR ubuntu\-dev\-tools (5)
42configuration files.
43In each case, the script\-specific variable takes precedence over the
44package\-wide variable.
45.TP
46.BR LP_SET_DUP_LPINSTANCE ", " UBUNTUTOOLS_LPINSTANCE
47The default value for \fB--lpinstance\fR.
48
49.SH SEE ALSO
50.BR ubuntu\-dev\-tools (5)
51
52.SH AUTHORS
53\fBlp\-set\-dup\fR was written by LoĂ¯c Minier <lool@dooz.org>,
54and this manual page was written by Luca Falavigna <dktrkranz@debian.org>.
55.PP
56Both are released under the terms of the GNU General Public License, version 2.
570
=== removed file 'doc/lp-shell.1'
--- doc/lp-shell.1 2011-08-14 16:54:53 +0000
+++ doc/lp-shell.1 1970-01-01 00:00:00 +0000
@@ -1,52 +0,0 @@
1.TH lp-shell "1" "27 March 2010" "ubuntu-dev-tools"
2.SH NAME
3lp\-shell \- Open an interactive launchpadlib shell.
4
5.SH SYNOPSIS
6.B lp\-shell
7.RB [ \-a ]
8.RB [ \-\-python ]
9.RB [ \-\-ipython ]
10.RI [ service ]
11.RI [ "LP API version" ]
12
13.SH DESCRIPTION
14.B lp\-shell
15opens an interactive Python shell with a launchpadlib.Launchpad object "lp"
16which is ready for use.
17
18It authenticates against Launchpad with the consumer name "udt-lp-shell". When
19using \fBlp\-shell\fR with the \fB\-a\fR option it will use the anonymous login
20from launchpadlib.Launchpad.
21
22By default \fBlp\-shell\fR connects to the "\fIproduction\fR" Launchpad service
23using the "\fI1.0\fR" LP API version.
24
25If you want to connect to another Launchpad service, call \fBlp\-shell\fR with
26the service name as the second argument. \fBlp\-shell\fR supports all services
27known by launchpadlib Python module.
28Currently known are (list can be incomplete or outdated): "production",
29"staging", "dogfood".
30
31A different LP API version can be selected by passing the API version to use as
32the third argument. Current supported are: "beta", "1.0" and "devel".
33
34.SH OPTIONS
35.TP
36.B \-a
37Login anonymously into Launchpad.
38
39.TP
40.B \-\-ipython
41Use an ipython shell if available (default).
42
43.TP
44.B \-\-python
45Use a regular python shell.
46
47.SH AUTHORS
48.B lp\-shell
49was written by Martin Pitt <martin.pitt@ubuntu.com>.
50.PP
51It is released under the terms of the GNU General Public License, version 2
52or (at your option) any later version.
530
=== removed file 'get-branches'
--- get-branches 2011-05-24 18:22:37 +0000
+++ get-branches 1970-01-01 00:00:00 +0000
@@ -1,118 +0,0 @@
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3#
4# Copyright (C) 2007 Canonical Ltd.
5# Created by Daniel Holbach <daniel.holbach@ubuntu.com>
6# Modified by Jonathan Patrick Davies <jpds@ubuntu.com>
7#
8# ##################################################################
9#
10# This program is free software; you can redistribute it and/or
11# modify it under the terms of the GNU General Public License
12# as published by the Free Software Foundation; version 3.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# See file /usr/share/common-licenses/GPL-3 for more details.
20#
21# ##################################################################
22#
23# This script is used to checkout or branch all the Bazaar branches
24# of a Launchpad team.
25#
26
27import os
28import sys
29from optparse import OptionParser
30from ubuntutools.lp.lpapicache import PersonTeam
31from ubuntutools import subprocess
32
33def main():
34 usage = "Usage: %prog [-d <directory>] -t <team> [-o <operation>]"
35 usage += "\nUsage: %prog <team>"
36 opt_parser = OptionParser(usage)
37
38 # Our options.
39 opt_parser.add_option("-d", "--directory", action="store", type="string",
40 dest="directory", default=os.getcwd(),
41 help="Directory to download branches to.")
42 opt_parser.add_option("-t", "--team", action="store", type="string",
43 dest="lpteam",
44 help="Launchpad team to download branches from.")
45 opt_parser.add_option("-o", "--operation", action="store", type="string",
46 dest="operation", default="branch",
47 help="Whether to branch or checkout the Bazaar "
48 "branches. May be either 'branch' or "
49 "'checkout'.")
50
51 (options, args) = opt_parser.parse_args()
52
53 # Fetch our current directory to return to later.
54 pwd = os.getcwd()
55
56 # Parse our options.
57 if len(args) != 1 and options.lpteam == None:
58 opt_parser.error("No team has been specified.")
59
60 # Dictionary settings.
61 directory = options.directory
62 if not os.path.isdir(directory): # Check that it is a directory.
63 opt_parser.error("%s is not a valid directory." % directory)
64 os.chdir(directory)
65
66 # Type of Bazaar operation to perform.
67 operation_type = options.operation.lower()
68 if operation_type not in ("branch", "checkout"):
69 opt_parser.error("Invalid operation '%s' for '-o' flag." % \
70 operation_type)
71
72 # Launchpad team setting.
73 if options.lpteam:
74 team = options.lpteam.lower()
75 if args:
76 team = args[0].lower()
77 try:
78 team = PersonTeam(team)
79 except KeyError:
80 print >> sys.stderr, "E: The team '%s' doesn't exist." % team
81
82 # Get a list of branches
83 branches = team.getBranches()
84
85 print "Downloading all branches for the '%s' team. This may take some " \
86 "time." % team.display_name
87
88 try:
89 os.makedirs(team.name)
90 except:
91 pass
92
93 os.chdir(team.name)
94
95 for branch in branches:
96 project_name = branch.project.name
97 if not os.path.exists(project_name):
98 os.makedirs(project_name)
99 os.chdir(project_name)
100
101 if not os.path.exists(branch.name):
102 print "Branching %s ..." % branch.display_name
103 cmd = ["bzr", operation_type, branch.bzr_identity, branch.name]
104 subprocess.call(cmd)
105 else:
106 print "Merging %s ..." % branch.display_name
107 os.chdir(branch.name)
108 subprocess.call(["bzr", "merge", "--pull", "--remember"])
109 os.chdir(os.path.join(directory, team.name))
110
111 os.chdir(pwd)
112 sys.exit(0)
113
114if __name__ == "__main__":
115 try:
116 main()
117 except KeyboardInterrupt:
118 print "Operation was interrupted by user."
1190
=== removed file 'grab-attachments'
--- grab-attachments 2011-06-21 16:25:15 +0000
+++ grab-attachments 1970-01-01 00:00:00 +0000
@@ -1,107 +0,0 @@
1#!/usr/bin/python
2#
3# Copyright (C) 2007, Canonical Ltd.
4# Written by Daniel Holbach,
5# Stefano Rivera,
6# Brian Murray
7#
8# ##################################################################
9#
10# This program is free software; you can redistribute it and/or
11# modify it under the terms of the GNU General Public License
12# as published by the Free Software Foundation; version 3.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# See file /usr/share/common-licenses/GPL-3 for more details.
20#
21# ##################################################################
22
23from optparse import OptionParser
24import errno
25import os
26import sys
27
28from launchpadlib.launchpad import Launchpad
29
30from ubuntutools.config import UDTConfig
31
32USAGE = "grab-attachments <bug numbers>"
33
34
35def download_attachments(bug):
36
37 bug_folder_name = 'bug-%s' % bug.id
38
39 try:
40 os.mkdir(bug_folder_name)
41 except OSError, error:
42 if error.errno == errno.EEXIST:
43 return
44
45 for attachment in bug.attachments:
46 f = attachment.data.open()
47 filename = os.path.join(os.getcwd(), bug_folder_name, f.filename)
48 local_file = open(filename, "w")
49 local_file.write(f.read())
50 f.close()
51 local_file.close()
52
53
54def main():
55 parser = OptionParser('Usage: %prog [options] <bug numbers>')
56 parser.add_option('-l', '--lpinstance', metavar='INSTANCE',
57 dest='lpinstance', default=None,
58 help='Launchpad instance to connect to '
59 '(default: production)')
60 parser.add_option('--no-conf',
61 dest='no_conf', default=False, action='store_true',
62 help="Don't read config files or environment variables")
63 parser.add_option('-d', '--duplicates', default=False,
64 action='store_true',
65 help='Download attachments from duplicates too')
66 parser.add_option('-p', '--package',
67 help='Download attachments from all bugs with a '
68 'task for this source package')
69
70 opts, args = parser.parse_args()
71 if len(args) < 1 and not opts.package:
72 parser.error('No bug numbers provided')
73 config = UDTConfig(opts.no_conf)
74 if opts.lpinstance is None:
75 opts.lpinstance = config.get_value('LPINSTANCE')
76
77 try:
78 launchpad = Launchpad.login_with("ubuntu-dev-tools", opts.lpinstance)
79
80 if opts.package:
81 ubuntu = launchpad.projects['ubuntu']
82 src_package = ubuntu.getSourcePackage(name=opts.package)
83 if src_package is None:
84 parser.error('Unable to find package %s' % opts.package)
85 for task in src_package.searchTasks():
86 args.append(task.bug.id)
87
88 for arg in args:
89 try:
90 bug_number = int(arg)
91 except ValueError:
92 parser.error("'%s' is not a valid bug number." % arg)
93
94 bug = launchpad.bugs[bug_number]
95 download_attachments(bug)
96
97 if opts.duplicates is True:
98 for bug in bug.duplicates:
99 download_attachments(bug)
100
101 # no LP credentials
102 except IOError, error:
103 print error
104 sys.exit(1)
105
106if __name__ == '__main__':
107 main()
1080
=== removed file 'lp-list-bugs'
--- lp-list-bugs 2011-02-28 22:30:54 +0000
+++ lp-list-bugs 1970-01-01 00:00:00 +0000
@@ -1,63 +0,0 @@
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
25import sys
26from optparse import OptionParser
27
28from launchpadlib.launchpad import Launchpad
29from launchpadlib.errors import HTTPError
30
31def 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
62if __name__ == '__main__':
63 main()
640
=== removed file 'lp-project-upload'
--- lp-project-upload 2011-06-24 14:32:07 +0000
+++ lp-project-upload 1970-01-01 00:00:00 +0000
@@ -1,178 +0,0 @@
1#!/usr/bin/python
2
3# Copyright (c) 2009 Canonical Ltd.
4#
5# This program is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License as published by the
7# Free Software Foundation; either version 2, or (at your option) any
8# later version.
9#
10# lp-project-upload is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14
15# Authors:
16# Martin Pitt <martin.pitt@ubuntu.com>, based on
17# http://blog.launchpad.net/api/recipe-for-uploading-files-via-the-api
18# Dustin Kirkland <kirkland@ubuntu.com>
19# - support files for changelog and release notes
20
21'''Upload a release tarball to a Launchpad project.'''
22
23import datetime
24import os
25import sys
26import tempfile
27
28from launchpadlib.launchpad import Launchpad
29from launchpadlib.errors import HTTPError
30
31from ubuntutools import subprocess
32
33def create_release(project, version):
34 '''Create new release and milestone for LP project.'''
35
36 print 'Release %s could not be found for project. Create it? (Y/n)' % \
37 version
38 answer = sys.stdin.readline().strip()
39 if answer.startswith('n'):
40 sys.exit(0)
41
42 n_series = len(project.series)
43 if n_series == 1:
44 series = project.series[0]
45 elif n_series > 1:
46 msg = 'More than one series exist. Which one would you like to ' \
47 'upload to? Possible series are (listed as index, name):'
48 print msg
49 for idx, serie in enumerate(project.series):
50 print '\t%i - %s' % (idx, serie.name)
51 print 'Enter series index: '
52 answer = sys.stdin.readline().strip()
53 try:
54 series = project.series[int(answer)]
55 except (ValueError, IndexError):
56 print >> sys.stderr, 'The series index is invalid (%s).' % answer
57 sys.exit(3)
58 else:
59 print "Using series named '%s'" % series.name
60 else:
61 print >> sys.stderr, ('Does not support creating releases if no '
62 'series exists.')
63 sys.exit(3)
64
65 release_date = datetime.date.today().strftime('%Y-%m-%d')
66 milestone = series.newMilestone(name=version,
67 date_targeted=release_date)
68 return milestone.createProductRelease(date_released=release_date)
69
70def edit_file(prefix, description):
71 (fd, f) = tempfile.mkstemp(prefix=prefix+'.')
72 os.write(fd, '\n\n#------\n# Please enter the %s here. '
73 'Lines which start with "#" are ignored.\n' % description)
74 os.close(fd)
75 subprocess.call(['sensible-editor', f])
76 return cat_file(f)
77
78def cat_file(f):
79 content = ''
80 for line in open(f):
81 if line.startswith('#'):
82 continue
83 content += line
84 return content.strip()
85
86def main():
87 if len(sys.argv) < 4 or len(sys.argv) > 7:
88 print >> sys.stderr, '''Upload a release tarball to a Launchpad project.
89
90 Usage: %s <project name> <version> <tarball> [new milestone] [changelog file] [releasenotes file]''' % sys.argv[0]
91 sys.exit(1)
92
93 new_milestone = None
94 changelog_file = None
95 releasenotes_file = None
96 if len(sys.argv) == 4:
97 (project, version, tarball) = sys.argv[1:]
98 elif len(sys.argv) == 5:
99 (project, version, tarball, new_milestone) = sys.argv[1:]
100 elif len(sys.argv) == 6:
101 (project, version, tarball, new_milestone, changelog_file) = sys.argv[1:]
102 elif len(sys.argv) == 7:
103 (project, version, tarball, new_milestone, changelog_file, releasenotes_file) = sys.argv[1:]
104
105 try:
106 launchpad = Launchpad.login_with('ubuntu-dev-tools', 'production')
107 except Exception, error:
108 print >> sys.stderr, 'Could not connect to Launchpad:', str(error)
109 sys.exit(2)
110
111 try:
112 # Look up the project using the Launchpad instance.
113 proj = launchpad.projects[project]
114 # Find the release in the project's releases collection.
115 release = None
116 for rel in proj.releases:
117 if rel.version == version:
118 release = rel
119 break
120 if not release:
121 for milestone in proj.all_milestones:
122 if milestone.name == version:
123 today = datetime.date.today().strftime('%Y-%m-%d')
124 release = milestone.createProductRelease(date_released=today)
125 if not release:
126 release = create_release(proj, version)
127
128 # Get the file contents.
129 file_content = open(tarball, 'r').read()
130 # Get the signature, if available.
131 signature = tarball + '.asc'
132 if not os.path.exists(signature):
133 print 'Calling GPG to create tarball signature...'
134 cmd = ['gpg', '--armor', '--sign', '--detach-sig', tarball]
135 if subprocess.call(cmd) != 0:
136 print >> sys.stderr, 'gpg failed, aborting'
137
138 if os.path.exists(signature):
139 signature_content = open(signature, 'r').read()
140 else:
141 signature_content = None
142
143 # Create a new product release file.
144 filename = os.path.basename(tarball)
145 release.add_file(filename=filename, description='release tarball',
146 file_content=file_content, content_type='appplication/x-gzip',
147 file_type='Code Release Tarball', signature_filename=signature,
148 signature_content=signature_content)
149
150 if changelog_file is not None:
151 changelog = cat_file(changelog_file)
152 else:
153 changelog = edit_file('changelog', 'changelog')
154 if changelog:
155 release.changelog = changelog
156
157 if releasenotes_file is not None:
158 release_notes = cat_file(releasenotes_file)
159 else:
160 release_notes = edit_file('releasenotes', 'release notes')
161 if release_notes:
162 release.release_notes = release_notes
163
164 release.lp_save()
165
166 # Create a new milestone if requested
167 if new_milestone is not None:
168 mil = release.milestone
169 for series in proj.series:
170 if mil.name in [milestone.name for milestone in series.all_milestones]:
171 series.newMilestone(name=new_milestone)
172
173 except HTTPError, error:
174 print 'An error happened in the upload:', error.content
175 sys.exit(1)
176
177if __name__ == '__main__':
178 main()
1790
=== removed file 'lp-set-dup'
--- lp-set-dup 2011-02-28 22:30:54 +0000
+++ lp-set-dup 1970-01-01 00:00:00 +0000
@@ -1,134 +0,0 @@
1#!/usr/bin/python
2# -*- coding: UTF-8 -*-
3"""Sets the "duplicate of" bug of a bug and its dups."""
4
5# Copyright (c) 2009 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 2, 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# LoĂ¯c Minier <lool@dooz.org>
24
25import sys
26from optparse import OptionParser
27
28from launchpadlib.launchpad import Launchpad
29from launchpadlib.errors import HTTPError
30
31from ubuntutools.config import UDTConfig
32
33def die(message):
34 print >> sys.stderr, "Fatal: " + message
35 sys.exit(1)
36
37def main():
38 usage = "Usage: %prog [-f] <new main bug> <bug to dup> [<bug to dup>...]"
39 opt_parser = OptionParser(usage)
40 opt_parser.add_option("-f",
41 help="Skip confirmation prompt",
42 dest="force", default=False, action="store_true")
43 opt_parser.add_option("-l", "--lpinstance", metavar="INSTANCE",
44 help="Launchpad instance to connect to "
45 "(default: production)",
46 dest="lpinstance", default=None)
47 opt_parser.add_option("--no-conf",
48 help="Don't read config files or "
49 "environment variables.",
50 dest="no_conf", default=False, action="store_true")
51 (options, args) = opt_parser.parse_args()
52
53 if len(args) < 2:
54 opt_parser.error("Need at least a new main bug and a bug to dup")
55
56 config = UDTConfig(options.no_conf)
57 if options.lpinstance is None:
58 options.lpinstance = config.get_value("LPINSTANCE")
59
60 launchpad = None
61 try:
62 print "Setting up Launchpad"
63 launchpad = Launchpad.login_with("ubuntu-dev-tools", options.lpinstance)
64 print "Launchpad setup complete"
65 except ImportError:
66 suggestion = "check whether python-launchpadlib is installed"
67 if launchpad is None:
68 die("Couldn't setup Launchpad for the ubuntu-dev-tools consumer; %s" % \
69 (suggestion, ))
70
71 # check that the new main bug isn't a duplicate
72 try:
73 new_main_bug = launchpad.bugs[args[0]]
74 except HTTPError, error:
75 if error.response.status == 401:
76 print >> sys.stderr, ("E: Don't have enough permissions to access "
77 "bug %s") % (args[0])
78 die(error.content)
79 else:
80 raise
81 new_main_dup_of = new_main_bug.duplicate_of
82 if new_main_dup_of is not None:
83 answer = None
84 try:
85 answer = raw_input("Bug %s is a duplicate of %s; would you like to "
86 "use %s as the new main bug instead? [y/N]" % \
87 (new_main_bug.id, new_main_dup_of.id,
88 new_main_dup_of.id))
89 except:
90 die("Aborted")
91 if answer.lower() not in ("y", "yes"):
92 die("User aborted")
93 new_main_bug = new_main_dup_of
94
95 # build list of bugs to process, first the dups then the bug
96 bugs_to_process = []
97 for bug_number in args[1:]:
98 print "Processing %s" % (bug_number)
99 try:
100 bug = launchpad.bugs[bug_number]
101 except HTTPError, error:
102 if error.response.status == 401:
103 print >> sys.stderr, ("W: Don't have enough permissions to "
104 "access bug %s") % (bug_number)
105 print >> sys.stderr, "W: %s" % (error.content)
106 continue
107 else:
108 raise
109 dups = bug.duplicates
110 if dups is not None:
111 bugs_to_process.extend(dups)
112 print "Found %i dups for %s" % (len(dups), bug_number)
113 bugs_to_process.append(bug)
114
115 # process dups first, then their main bug
116 print "Would set the following bugs as duplicates of %s: %s" % \
117 (new_main_bug.id, " ".join([str(b.id) for b in bugs_to_process]))
118
119 if not options.force:
120 answer = None
121 try:
122 answer = raw_input("Proceed? [y/N]")
123 except:
124 die("Aborted")
125 if answer.lower() not in ("y", "yes"):
126 die("User aborted")
127
128 for bug in bugs_to_process:
129 print "Marking bug %s as a duplicate of %s" % (bug.id, new_main_bug.id)
130 bug.duplicate_of = new_main_bug
131 bug.lp_save()
132
133if __name__ == '__main__':
134 main()
1350
=== removed file 'lp-shell'
--- lp-shell 2011-08-20 09:31:02 +0000
+++ lp-shell 1970-01-01 00:00:00 +0000
@@ -1,112 +0,0 @@
1#!/usr/bin/python
2
3# Open an interactive launchpadlib Python shell.
4# It supports all known LP service instances and API versions. The login
5# can optionally happen anonymously.
6
7# Author: Martin Pitt <martin.pitt@ubuntu.com>
8# Copyright: (C) 2010 Canonical Ltd.
9#
10# This package is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation, at version 2.
13#
14# This package is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18
19import sys
20import code
21from optparse import OptionParser
22
23from launchpadlib.launchpad import Launchpad
24from launchpadlib.uris import lookup_service_root
25
26def main():
27 instance = 'production'
28 valid_api_versions = ('beta', '1.0', 'devel')
29 api_version = '1.0'
30
31 usage = 'Usage: %prog [-a] [instance] [LP API version]'
32 opt_parser = OptionParser(usage)
33 opt_parser.add_option('-a', action='store_true',
34 dest='anonymous', default=False,
35 help='Login anonymously into LP.')
36 opt_parser.add_option('--ipython', action='store_const',
37 dest='shell', const='ipython', default="ipython",
38 help='Use ipython shell (default).')
39 opt_parser.add_option('--python', action='store_const',
40 dest='shell', const='python',
41 help='Use python shell.')
42
43
44 (options, args) = opt_parser.parse_args()
45
46 if len(args) >= 1:
47 try:
48 instance = lookup_service_root(args[0])
49 except ValueError, err:
50 print 'E: %s' % (err)
51 print 'I: Falling back to "production".'
52
53 if len(args) >= 2:
54 if args[1] in valid_api_versions:
55 api_version = args[1]
56 else:
57 print 'E: "%s" is not a valid LP API version.' % (args[1])
58 print 'I: Falling back to "1.0".'
59
60 if options.anonymous:
61 launchpad = Launchpad.login_anonymously('udt-lp-shell', instance,
62 version=api_version)
63 banner = ('Connected anonymously to LP service "%s" with API version '
64 '"%s":' % (instance, api_version))
65 else:
66 launchpad = Launchpad.login_with('udt-lp-shell', instance,
67 version=api_version)
68 banner = 'Connected to LP service "%s" with API version "%s":' % \
69 (instance, api_version)
70
71 banner += '\nNote: LP can be accessed through the "lp" object.'
72
73 sh = None
74 if options.shell == "ipython":
75 try:
76 try: # ipython >= 0.11
77 from IPython.frontend.terminal.embed import InteractiveShellEmbed
78 sh = InteractiveShellEmbed(banner2=banner, user_ns={'lp': launchpad})
79 except ImportError: # ipython < 0.11
80 # pylint does not handle nested try-except, disable import error
81 # pylint: disable-msg=E0611
82 from IPython.Shell import IPShellEmbed
83 sh = IPShellEmbed(argv=[], user_ns={'lp': launchpad})
84 sh.set_banner(sh.IP.BANNER + '\n' + banner)
85 sh.excepthook = sys.__excepthook__
86 except ImportError:
87 print "E: ipython not available. Using normal python shell."
88
89 if sh:
90 sh()
91 else:
92 class CompleterConsole(code.InteractiveConsole):
93 def __init__(self):
94 local = {'lp': launchpad}
95 code.InteractiveConsole.__init__(self, locals=local)
96 try:
97 import readline
98 except ImportError:
99 print 'I: readline module not available.'
100 else:
101 import rlcompleter
102 readline.parse_and_bind("tab: complete")
103
104 # Disable default apport hook, as lp-shell is intended for interactive use
105 # and thus exceptions often bubble up to the top level.
106 sys.excepthook = sys.__excepthook__
107
108 console = CompleterConsole()
109 console.interact(banner)
110
111if __name__ == '__main__':
112 main()
1130
=== modified file 'setup.py'
--- setup.py 2011-07-01 20:07:08 +0000
+++ setup.py 2011-09-02 11:53:47 +0000
@@ -20,18 +20,12 @@
20 'check-symbols',20 'check-symbols',
21 'dch-repeat',21 'dch-repeat',
22 'dgetlp',22 'dgetlp',
23 'get-branches',
24 'get-build-deps',23 'get-build-deps',
25 'grab-attachments',
26 'grab-merge',24 'grab-merge',
27 'grep-merges',25 'grep-merges',
28 'harvest',26 'harvest',
29 'hugdaylist',27 'hugdaylist',
30 'import-bug-from-debian',28 'import-bug-from-debian',
31 'lp-list-bugs',
32 'lp-project-upload',
33 'lp-set-dup',
34 'lp-shell',
35 'massfile',29 'massfile',
36 'merge-changelog',30 'merge-changelog',
37 'mk-sbuild',31 'mk-sbuild',
3832
=== modified file 'ubuntutools/test/test_help.py'
--- ubuntutools/test/test_help.py 2011-05-24 18:22:37 +0000
+++ ubuntutools/test/test_help.py 2011-09-02 11:53:47 +0000
@@ -29,8 +29,6 @@
29 'check-symbols': 'No Help',29 'check-symbols': 'No Help',
30 'get-build-deps': 'No Help, runs sudo',30 'get-build-deps': 'No Help, runs sudo',
31 'grep-merges': 'No Help',31 'grep-merges': 'No Help',
32 'lp-project-upload': 'Returns non-zero after help. '
33 'Leaving u-d-t in LP: #524680',
34 'pbuilder-dist-simple': 'No Help',32 'pbuilder-dist-simple': 'No Help',
35 'setup-packaging-environment': 'Throws Error',33 'setup-packaging-environment': 'Throws Error',
36 'submittodebian': 'No Help',34 'submittodebian': 'No Help',