mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-20 13:21:28 +00:00
Use the improved staging support in lpapicache
This commit is contained in:
parent
13cbe49a19
commit
a435c3234b
@ -91,10 +91,6 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# import the needed requestsync module
|
# import the needed requestsync module
|
||||||
if options.lpapi:
|
if options.lpapi:
|
||||||
# Needs to be set before lpapicache is imported:
|
|
||||||
import ubuntutools.lp
|
|
||||||
ubuntutools.lp.service = options.lpinstance
|
|
||||||
|
|
||||||
from ubuntutools.requestsync.lp import (checkExistingReports,
|
from ubuntutools.requestsync.lp import (checkExistingReports,
|
||||||
getDebianSrcPkg,
|
getDebianSrcPkg,
|
||||||
getUbuntuSrcPkg,
|
getUbuntuSrcPkg,
|
||||||
@ -103,7 +99,7 @@ if __name__ == '__main__':
|
|||||||
# See if we have LP credentials and exit if we don't - cannot continue in this case
|
# See if we have LP credentials and exit if we don't - cannot continue in this case
|
||||||
|
|
||||||
try:
|
try:
|
||||||
Launchpad.login()
|
Launchpad.login(service=options.lpinstance)
|
||||||
except IOError:
|
except IOError:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
|
@ -52,11 +52,12 @@ __all__ = [
|
|||||||
class Launchpad(object):
|
class Launchpad(object):
|
||||||
'''Singleton for LP API access.'''
|
'''Singleton for LP API access.'''
|
||||||
|
|
||||||
def login(self):
|
def login(self, service=service):
|
||||||
'''Enforce a non-anonymous login.'''
|
'''Enforce a non-anonymous login.'''
|
||||||
if '_Launchpad__lp' not in self.__dict__:
|
if '_Launchpad__lp' not in self.__dict__:
|
||||||
try:
|
try:
|
||||||
self.__lp = libsupport.get_launchpad('ubuntu-dev-tools')
|
self.__lp = libsupport.get_launchpad('ubuntu-dev-tools',
|
||||||
|
server=service)
|
||||||
except IOError, error:
|
except IOError, error:
|
||||||
print >> sys.stderr, 'E: %s' % error
|
print >> sys.stderr, 'E: %s' % error
|
||||||
raise
|
raise
|
||||||
|
Loading…
x
Reference in New Issue
Block a user