changeset 4141:049b9aaf3031

Whitespace fixes and extended logging of calls
author Florian Krupicka <florian.krupicka@googlemail.com>
date Thu, 29 May 2008 18:17:49 +0200
parents 5f4831ba630e
children 26dbb6d47863
files MoinMoin/action/__init__.py MoinMoin/request/__init__.py MoinMoin/web/contexts.py MoinMoin/wsgiapp.py
diffstat 4 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/__init__.py	Thu May 29 17:17:49 2008 +0200
+++ b/MoinMoin/action/__init__.py	Thu May 29 18:17:49 2008 +0200
@@ -303,8 +303,8 @@
 
 # Dispatching ----------------------------------------------------------------
 def get_names(config):
-    """ Get a list of known actions. 
-    
+    """ Get a list of known actions.
+
     @param config: a config object
     @rtype: set
     @return: set of known actions
@@ -339,10 +339,10 @@
 
         The set does not contain actions that starts with lower case.
         Themes use this set to display the actions to the user.
-   
+
         @param config: a config object (for the per-wiki actions)
         @param page: the page to which the actions should apply
-        @param user: the user which wants the 
+        @param user: the user which wants to apply an action
         @rtype: set
         @return: set of avaiable actions
         """
--- a/MoinMoin/request/__init__.py	Thu May 29 17:17:49 2008 +0200
+++ b/MoinMoin/request/__init__.py	Thu May 29 18:17:49 2008 +0200
@@ -773,7 +773,7 @@
         """
         if getattr(self, '_available_actions', None) is None:
             self._available_actions = get_available_actions(self.cfg, page, self.user)
-            
+
         # Return a copy, so clients will not change the dict.
         return self._available_actions.copy()
 
@@ -1133,7 +1133,7 @@
 
     def run(self):
         # Exit now if __init__ failed or request is forbidden
-        if self.failed or self.forbidden or self._auth_redirected:
+        if self.forbidden or self._auth_redirected:
             # Don't sleep() here, it binds too much of our resources!
             return self.finish()
 
--- a/MoinMoin/web/contexts.py	Thu May 29 17:17:49 2008 +0200
+++ b/MoinMoin/web/contexts.py	Thu May 29 18:17:49 2008 +0200
@@ -29,7 +29,7 @@
     Contains code related to manipulation of HTTP related data like:
     * Headers
     * Cookies
-    * GET/POST/PUT/etc data 
+    * GET/POST/PUT/etc data
     """
     def __init__(self, environ):
         self._wsgirequest = Request(environ)
@@ -84,9 +84,10 @@
 def _logfunc(func):
     def _decorated(*args, **kwargs):
         stack = inspect.stack()
-        caller, lineno = stack[1][3], stack[1][0].f_lineno
-        logging.warning("Function '%s' called by '%s' in line '%s'",
-                        func.__name__, caller, lineno)
+        parent = stack[1]
+        caller, filename, lineno = parent[3], parent[1], parent[0].f_lineno
+        logging.warning("Function '%s' called by '%s' in file '%s', line '%s'",
+                        func.__name__, caller, filename, lineno)
         return func(*args, **kwargs)
     _decorated.__name__ = func.__name__
     _decorated.__doc__ = func.__doc__
--- a/MoinMoin/wsgiapp.py	Thu May 29 17:17:49 2008 +0200
+++ b/MoinMoin/wsgiapp.py	Thu May 29 18:17:49 2008 +0200
@@ -27,7 +27,6 @@
         response.response = file_wrapper(request._send_file, request._send_bufsize)
     else:
         response.response = request.output()
-        print request.output()
     return response
 
 application = responder(application)