Rev 5250: Allow login by url in lp_api. in http://bazaar.launchpad.net/~lifeless/bzr/fetch-proposed
Robert Collins
robertc at robertcollins.net
Sat May 22 10:44:48 BST 2010
At http://bazaar.launchpad.net/~lifeless/bzr/fetch-proposed
------------------------------------------------------------
revno: 5250
revision-id: robertc at robertcollins.net-20100522094447-5ucgm8tnxbfwoz6o
parent: robertc at robertcollins.net-20100521214921-lvudo5cqxreef010
committer: Robert Collins <robertc at robertcollins.net>
branch nick: fetch-proposed
timestamp: Sat 2010-05-22 21:44:47 +1200
message:
Allow login by url in lp_api.
=== modified file 'bzrlib/plugins/launchpad/lp_api.py'
--- a/bzrlib/plugins/launchpad/lp_api.py 2010-05-21 21:49:21 +0000
+++ b/bzrlib/plugins/launchpad/lp_api.py 2010-05-22 09:44:47 +0000
@@ -102,14 +102,14 @@
raise InvalidLaunchpadInstance(lp_instance)
-def login(service, timeout=None, proxy_info=None):
+def login_url(url, timeout=None, proxy_info=None):
"""Log in to the Launchpad API.
:return: The root `Launchpad` object from launchpadlib.
"""
cache_directory = get_cache_directory()
launchpad = Launchpad.login_with(
- 'bzr', _get_api_url(service), cache_directory, timeout=timeout,
+ 'bzr', url, cache_directory, timeout=timeout,
proxy_info=proxy_info)
# XXX: Work-around a minor security bug in launchpadlib 1.5.1, which would
# create this directory with default umask.
@@ -117,6 +117,14 @@
return launchpad
+def login(service, timeout=None, proxy_info=None):
+ """Log in to the Launchpad API.
+
+ :return: The root `Launchpad` object from launchpadlib.
+ """
+ return login_url(_get_api_url(service), timeout, proxy_info)
+
+
class LaunchpadBranch(object):
"""Provide bzr and lp API access to a Launchpad branch."""
More information about the bazaar-commits
mailing list