changeset 98:9e1e736958a2

deprecate
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 30 Nov 2013 17:44:41 -0800
parents a20fd4fef727
children 8d8f639d563f
files bitsyblog/bitsyblog.py
diffstat 1 files changed, 14 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/bitsyblog/bitsyblog.py	Sat Nov 30 14:52:43 2013 -0800
+++ b/bitsyblog/bitsyblog.py	Sat Nov 30 17:44:41 2013 -0800
@@ -131,21 +131,18 @@
         request = Request(environ)
 
         # genshi data dictionary
-        request.environ['data'] = { 'site_name': self.site_name,
-                                    'request': request,
-                                    'link': self.link,
-                                    'logo': self.logo(request),
-                                    'header': self.header,
-                                    'user_url': self.user_url,
-                                    'permalink': self.permalink }
+        request.environ['data'] = {'site_name': self.site_name,
+                                   'request': request,
+                                   'link': self.link,
+                                   'logo': self.logo(request),
+                                   'header': self.header,
+                                   'user_url': self.user_url,
+                                   'permalink': self.permalink }
 
         res = self.response_functions.get(request.method, self.method_not_allowed)(request)
         return res(environ, start_response)
 
-    def get_response(self, text, content_type='text/html'):
-        # XXX to deprecate
-        res = Response(content_type=content_type, body=text)
-        return res
+    ## GET
 
     def logo(self, request):
         """link to the logo"""
@@ -286,6 +283,8 @@
         user, path = self.userpath(request)
         return self.get_user_space(user, path, request)
 
+    ## POST
+
     def post(self, request):
         """
         write a blog entry and other POST requests
@@ -314,9 +313,11 @@
 
                 errors = self.users.write_settings(user, **settings)
                 if errors: # re-display form with errors
-                    return self.get_response(self.preferences(request, user, errors))
+                    return Response(content_type='text/html',
+                                    body=self.preferences(request, user, errors))
 
-                return self.get_response(self.preferences(request, user, message='Changes saved'))
+                return Response(content_type='text/html',
+                                body=self.preferences(request, user, message='Changes saved'))
             elif len(path) == 1 and self.isentry(path[0]):
                 entry = self.blog.entry(user, path[0], roles['author'])
                 if entry is None: