Skip to content

Commit

Permalink
Pep8 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeeters committed Apr 8, 2014
1 parent 4b9b729 commit bbfd060
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions auth/basic.rst
Expand Up @@ -17,18 +17,18 @@ Here's an implementation of an HTTP basic auth Pyramid authentication policy::
authorization = AUTHORIZATION(request.environ)
try:
authmeth, auth = authorization.split(' ', 1)
except ValueError: # not enough values to unpack
except ValueError: # not enough values to unpack
return None
if authmeth.lower() == 'basic':
try:
auth = auth.strip().decode('base64')
except binascii.Error: # can't decode
except binascii.Error: # can't decode
return None
try:
login, password = auth.split(':', 1)
except ValueError: # not enough values to unpack
except ValueError: # not enough values to unpack
return None
return {'login':login, 'password':password}
return {'login': login, 'password': password}

return None

Expand Down Expand Up @@ -60,7 +60,7 @@ Here's an implementation of an HTTP basic auth Pyramid authentication policy::
if credentials is None:
return None
userid = credentials['login']
if self.check(credentials, request) is not None: # is not None!
if self.check(credentials, request) is not None: # is not None!
return userid

def effective_principals(self, request):
Expand All @@ -70,7 +70,7 @@ Here's an implementation of an HTTP basic auth Pyramid authentication policy::
return effective_principals
userid = credentials['login']
groups = self.check(credentials, request)
if groups is None: # is None!
if groups is None: # is None!
return effective_principals
effective_principals.append(Authenticated)
effective_principals.append(userid)
Expand Down

0 comments on commit bbfd060

Please sign in to comment.