Hi Leonard,
This branch looks good. Just one comment below.
merge-approved
-Edwin
>=== modified file 'src/launchpadlib/credentials.py' >--- src/launchpadlib/credentials.py 2009-10-27 15:24:36 +0000 >+++ src/launchpadlib/credentials.py 2009-10-28 20:22:45 +0000 >+ >+ def get_http_credentials(self, cached_username=None, failed_attempts=0):
Missing docstring.
>+ username = self.input_username( >+ cached_username, self.message(self.INPUT_USERNAME)) >+ if username is None: >+ self.open_login_page_in_user_browser( >+ urljoin(self.web_root, "+login")) >+ raise NoLaunchpadAccount( >+ self.message(self.YOU_NEED_A_LAUNCHPAD_ACCOUNT)) >+ password = self.input_password(self.message(self.INPUT_PASSWORD)) >+ response, content = self.browser.get_token_info( >+ username, password, self.request_token, self.allow_access_levels) >+ if response.status == 500: >+ raise ServerError(self.message(SERVER_ERROR)) >+ elif response.status == 401: >+ failed_attempts += 1 >+ if failed_attempts == self.max_failed_attempts: >+ raise TooManyAuthenticationFailures( >+ self.message(self.TOO_MANY_AUTHENTICATION_FAILURES)) >+ else: >+ self.authentication_failure( >+ self.message(self.AUTHENTICATION_FAILURE)) >+ return self.get_http_credentials(username, failed_attempts) >+ token_info = simplejson.loads(content) >+ return username, password, token_info
« Back to merge proposal
Hi Leonard,
This branch looks good. Just one comment below.
merge-approved
-Edwin
>=== modified file 'src/launchpadl ib/credentials. py' b/credentials. py 2009-10-27 15:24:36 +0000 b/credentials. py 2009-10-28 20:22:45 +0000 credentials( self, cached_ username= None, failed_attempts=0):
>--- src/launchpadli
>+++ src/launchpadli
>+
>+ def get_http_
Missing docstring.
>+ username = self.input_ username( self.INPUT_ USERNAME) ) login_page_ in_user_ browser( self.web_ root, "+login")) self.YOU_ NEED_A_ LAUNCHPAD_ ACCOUNT) ) password( self.message( self.INPUT_ PASSWORD) ) get_token_ info( access_ levels) self.message( SERVER_ ERROR)) failed_ attempts: cationFailures( self.TOO_ MANY_AUTHENTICA TION_FAILURES) ) tion_failure( self.AUTHENTICA TION_FAILURE) ) http_credential s(username, failed_attempts) loads(content)
>+ cached_username, self.message(
>+ if username is None:
>+ self.open_
>+ urljoin(
>+ raise NoLaunchpadAccount(
>+ self.message(
>+ password = self.input_
>+ response, content = self.browser.
>+ username, password, self.request_token, self.allow_
>+ if response.status == 500:
>+ raise ServerError(
>+ elif response.status == 401:
>+ failed_attempts += 1
>+ if failed_attempts == self.max_
>+ raise TooManyAuthenti
>+ self.message(
>+ else:
>+ self.authentica
>+ self.message(
>+ return self.get_
>+ token_info = simplejson.
>+ return username, password, token_info