changeset 21:74b8a8793414

whitespace cleanup
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 17 Nov 2011 11:20:03 -0800
parents 9f4369b769d0
children 9aa73d2d5aa8
files bitsyauth/__init__.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/bitsyauth/__init__.py
+++ b/bitsyauth/__init__.py
@@ -57,17 +57,17 @@ class BitsyAuthInnerWare(object):
         else:
             self.urls.pop('join') # don't do joining
 
         # WSGI app securely wrapped
         self.wrapped_app = self.security_wrapper()
 
         if not CAPTCHA:
             self.captcha = False
-        
+
     ### WSGI/HTTP layer
 
     def __call__(self, environ, start_response):
 
         orig_environ = dict(environ)
 
         self.request = Request(environ)
         self.request.path_info = self.request.path_info.rstrip('/')
@@ -139,17 +139,17 @@ class BitsyAuthInnerWare(object):
 
     def url_lookup(self):
         retval = dict([ (value, key) for key, value
                         in self.urls.items() ])
         if self.captcha:
             retval.update(dict([(('/join/%s.png' % key), 'image_captcha')
                                 for key in self.keys]))
         return retval
-        
+
     def get_response(self, text, content_type='text/html'):
         res = Response(content_type=content_type, body=text)
         res.content_length = len(res.body)
         return res
 
     def make_response(self):
         url_lookup = self.url_lookup()
         path = self.request.path_info
@@ -158,17 +158,17 @@ class BitsyAuthInnerWare(object):
         # login and join shouldn't be accessible when logged in
         if self.request.environ.get('REMOTE_USER'):
             return self.redirect("You are already logged in")
 
         handler = url_lookup[path]
         function = getattr(self, handler)
 
         if self.request.method == 'GET':
-            # XXX could/should do this with decorators            
+            # XXX could/should do this with decorators
             return self.get_response(function(wrap=True),
                                      content_type=self.content_type.get(handler,'text/html'))
         if self.request.method == 'POST':
             post_func = getattr(self, handler + "_post")
             errors = post_func()
             if errors:
                 return self.get_response(function(errors=errors, wrap=True))
             else:
@@ -179,17 +179,17 @@ class BitsyAuthInnerWare(object):
         """redirect from instrinsic urls"""
         return exc.HTTPSeeOther(message, location=location or self.redirect_to)
 
     def image_captcha(self, wrap=True):
         """return data for the image"""
         key = self.request.path_info.split('/join/')[-1]
         key = int(key.split('.png')[0])
         return skimpyAPI.Png(self.keys[key], scale=3.0).data()
-                
+
     ### forms and their display methods
 
     ### login
 
     def login_form(self, referer=None, action=None):
         form = Form(action=action or '', submit='Login')
         form.add_element('textfield', 'Name', input_name='username')
         form.add_element('password', 'Password', input_name='password')
@@ -200,17 +200,17 @@ class BitsyAuthInnerWare(object):
     def login(self, errors=None, wrap=False, action=None):
         """login div"""
         referer = None
         if hasattr(self, 'request'):
             referer = self.request.referer
         form = self.login_form(action=action, referer=referer)
         join = self.urls.get('join')
         retval = form(errors)
-        if join:        
+        if join:
             retval += '<br/>\n' + markup.a('join', href="%s" % join)
         retval = markup.div(retval)
         if wrap:
             title = 'login'
             if self.site:
                 pagetitle = '%s - %s' % (title, self.site)
             retval = markup.wrap(markup.h1(title.title()) + retval,
                                  pagetitle=pagetitle)