diff --git a/ubuntutools/lp/lpapiwrapper.py b/ubuntutools/lp/lpapiwrapper.py index b4ca3e9..f276e56 100644 --- a/ubuntutools/lp/lpapiwrapper.py +++ b/ubuntutools/lp/lpapiwrapper.py @@ -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):