mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
lp-shell: Support all to the launchpadlib Python module known service names.
This commit is contained in:
parent
dcb7ccbaec
commit
c921eaf947
8
debian/changelog
vendored
8
debian/changelog
vendored
@ -1,3 +1,11 @@
|
||||
ubuntu-dev-tools (0.97) UNRELEASED; urgency=low
|
||||
|
||||
[ Michael Bienia ]
|
||||
* lp-shell: Support all to the launchpadlib Python module known service
|
||||
names.
|
||||
|
||||
-- Michael Bienia <geser@ubuntu.com> Thu, 18 Mar 2010 11:01:21 +0100
|
||||
|
||||
ubuntu-dev-tools (0.96) lucid; urgency=low
|
||||
|
||||
[ Michael Bienia ]
|
||||
|
@ -4,7 +4,7 @@ lp\-shell \- Open an interactive launchpadlib shell.
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B lp\-shell
|
||||
[ staging ]
|
||||
[service]
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B lp\-shell
|
||||
@ -13,11 +13,13 @@ which is ready for use.
|
||||
|
||||
It authenticates against Launchpad with the consumer name "test".
|
||||
|
||||
If you want to connect to staging instead of production, call
|
||||
It uses by default the "edge" Launchpad service and the default API version.
|
||||
If you want to connect to an other Launchpad service, call
|
||||
.B lp\-shell
|
||||
with the
|
||||
.B staging
|
||||
argument.
|
||||
with the service name as the second argument. lp-shell supports all services
|
||||
known by launchpadlib Python module.
|
||||
Currently known are (list can be incomplete or outdated): "production", "edge",
|
||||
"staging", "dogfood".
|
||||
|
||||
.SH AUTHORS
|
||||
.B lp\-shell
|
||||
|
14
lp-shell
14
lp-shell
@ -17,12 +17,16 @@
|
||||
|
||||
import code, os, sys
|
||||
|
||||
from launchpadlib.launchpad import Launchpad, STAGING_SERVICE_ROOT, EDGE_SERVICE_ROOT
|
||||
from launchpadlib.launchpad import Launchpad
|
||||
from launchpadlib.uris import lookup_service_root
|
||||
|
||||
if len(sys.argv) == 2 and sys.argv[1] == 'staging':
|
||||
instance = STAGING_SERVICE_ROOT
|
||||
else:
|
||||
instance = EDGE_SERVICE_ROOT
|
||||
instance = 'edge'
|
||||
if len(sys.argv) >= 2:
|
||||
try:
|
||||
instance = lookup_service_root(sys.argv[1])
|
||||
except ValueError, err:
|
||||
print 'E: %s' % (err)
|
||||
print 'W: Falling back to "edge"'
|
||||
|
||||
lp = Launchpad.login_with('test', instance)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user