* ubuntutools/lp/lpapiwrapper.py: Add a method to enforce a login through the LP API.

This commit is contained in:
Michael Bienia 2009-06-12 00:33:23 +02:00
parent 5d9ef43b25
commit d4f6f9079e

View File

@ -33,9 +33,16 @@ class Launchpad(object):
''' Singleton for LP API access. '''
__lp = None
def __getattr__(self, attr):
def login(self):
'''
Enforce a login through the LP API.
'''
if not self.__lp:
self.__lp = libsupport.get_launchpad('ubuntu-dev-tools')
def __getattr__(self, attr):
if not self.__lp:
self.login()
return getattr(self.__lp, attr)
def __call__(self):