changeset 940:595a285e634c

whitespace-only cleanup in request/*
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 16 Jul 2006 13:51:22 +0200
parents 916f6a5e4ca6
children 16f7b6728b4e
files MoinMoin/request/CGI.py MoinMoin/request/CLI.py MoinMoin/request/MODPYTHON.py MoinMoin/request/STANDALONE.py MoinMoin/request/TWISTED.py MoinMoin/request/WSGI.py
diffstat 6 files changed, 49 insertions(+), 49 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/request/CGI.py	Sun Jul 16 13:40:17 2006 +0200
+++ b/MoinMoin/request/CGI.py	Sun Jul 16 13:51:22 2006 +0200
@@ -28,7 +28,7 @@
 
         except Exception, err:
             self.fail(err)
-            
+
     def open_logs(self):
         # create log file for catching stderr output
         if not self.opened_logs:
@@ -48,7 +48,7 @@
 
     def flush(self):
         sys.stdout.flush()
-        
+
     def finish(self):
         RequestBase.finish(self)
         # flush the output, ignore errors caused by the user closing the socket
@@ -59,12 +59,12 @@
             if ex.errno != errno.EPIPE: raise
 
     # Headers ----------------------------------------------------------
-    
+
     def http_headers(self, more_headers=[]):
         # Send only once
         if getattr(self, 'sent_headers', None):
             return
-        
+
         self.sent_headers = 1
         have_ct = 0
 
--- a/MoinMoin/request/CLI.py	Sun Jul 16 13:40:17 2006 +0200
+++ b/MoinMoin/request/CLI.py	Sun Jul 16 13:51:22 2006 +0200
@@ -29,7 +29,7 @@
         RequestBase.__init__(self, properties)
         self.cfg.caching_formats = [] # don't spoil the cache
         self.initTheme() # usually request.run() does this, but we don't use it
-  
+
     def read(self, n=None):
         """ Read from input stream. """
         if n is None:
@@ -43,7 +43,7 @@
 
     def flush(self):
         sys.stdout.flush()
-        
+
     def finish(self):
         RequestBase.finish(self)
         # flush the output, ignore errors caused by the user closing the socket
--- a/MoinMoin/request/MODPYTHON.py	Sun Jul 16 13:40:17 2006 +0200
+++ b/MoinMoin/request/MODPYTHON.py	Sun Jul 16 13:51:22 2006 +0200
@@ -31,15 +31,15 @@
             # some mod_python 2.7.X has no get method for table objects,
             # so we make a real dict out of it first.
             if not hasattr(req.subprocess_env, 'get'):
-                env=dict(req.subprocess_env)
+                env = dict(req.subprocess_env)
             else:
-                env=req.subprocess_env
+                env = req.subprocess_env
             self._setup_vars_from_std_env(env)
             RequestBase.__init__(self)
 
         except Exception, err:
             self.fail(err)
-            
+
     def fixURI(self, env):
         """ Fix problems with script_name and path_info using
         PythonOption directive to rewrite URI.
@@ -71,7 +71,7 @@
             import urlparse
             scriptAndPath = urlparse.urlparse(self.request_uri)[2]
             self.script_name = location.rstrip('/')
-            path = scriptAndPath.replace(self.script_name, '', 1)            
+            path = scriptAndPath.replace(self.script_name, '', 1)
             self.path_info = wikiutil.url_unquote(path, want_unicode=False)
 
         RequestBase.fixURI(self, env)
@@ -103,9 +103,9 @@
                 # objects.
                 if hasattr(item, 'value'):
                     item = item.value
-                fixedResult.append(item)                
+                fixedResult.append(item)
             args[key] = fixedResult
-            
+
         return self.decodeArgs(args)
 
     def run(self, req):
@@ -131,7 +131,7 @@
     def flush(self):
         """ We can't flush it, so do nothing. """
         pass
-        
+
     def finish(self):
         """ Just return apache.OK. Status is set in req.status. """
         RequestBase.finish(self)
@@ -168,7 +168,7 @@
                 self._have_status = 1
         else:
             # this is a header we sent out
-            self.mpyreq.headers_out[key]=value
+            self.mpyreq.headers_out[key] = value
 
     def http_headers(self, more_headers=[]):
         """ Sends out headers and possibly sets default content-type
--- a/MoinMoin/request/STANDALONE.py	Sun Jul 16 13:40:17 2006 +0200
+++ b/MoinMoin/request/STANDALONE.py	Sun Jul 16 13:51:22 2006 +0200
@@ -14,7 +14,7 @@
 class Request(RequestBase):
     """ specialized on StandAlone Server (MoinMoin.server.standalone) requests """
     script_name = ''
-    
+
     def __init__(self, sa, properties={}):
         """
         @param sa: stand alone server object
@@ -26,14 +26,14 @@
             self.rfile = sa.rfile
             self.headers = sa.headers
             self.is_ssl = 0
-            
+
             # Copy headers
-            self.http_accept_language = (sa.headers.getheader('accept-language') 
+            self.http_accept_language = (sa.headers.getheader('accept-language')
                                          or self.http_accept_language)
-            self.http_user_agent = sa.headers.getheader('user-agent', '')            
+            self.http_user_agent = sa.headers.getheader('user-agent', '')
             co = filter(None, sa.headers.getheaders('cookie'))
             self.saved_cookie = ', '.join(co) or ''
-            
+
             # Copy rest from standalone request   
             self.server_name = sa.server.server_name
             self.server_port = str(sa.server.server_port)
@@ -48,7 +48,7 @@
             self.setURL(sa.headers)
 
             ##self.debugEnvironment(sa.headers)
-            
+
             RequestBase.__init__(self, properties)
 
         except Exception, err:
@@ -58,7 +58,7 @@
         """ Override to create standalone form """
         form = cgi.FieldStorage(self.rfile, headers=self.headers, environ={'REQUEST_METHOD': 'POST'})
         return RequestBase._setup_args_from_cgi_form(self, form)
-        
+
     def read(self, n=None):
         """ Read from input stream
         
@@ -83,7 +83,7 @@
 
     def flush(self):
         self.wfile.flush()
-        
+
     def finish(self):
         RequestBase.finish(self)
         self.wfile.flush()
@@ -93,16 +93,16 @@
     def http_headers(self, more_headers=[]):
         if getattr(self, 'sent_headers', None):
             return
-        
+
         self.sent_headers = 1
         user_headers = getattr(self, 'user_headers', [])
-        
+
         # check for status header and send it
         our_status = 200
         for header in more_headers + user_headers:
             if header.lower().startswith("status:"):
                 try:
-                    our_status = int(header.split(':', 1)[1].strip().split(" ", 1)[0]) 
+                    our_status = int(header.split(':', 1)[1].strip().split(" ", 1)[0])
                 except:
                     pass
                 # there should be only one!
--- a/MoinMoin/request/TWISTED.py	Sun Jul 16 13:40:17 2006 +0200
+++ b/MoinMoin/request/TWISTED.py	Sun Jul 16 13:51:22 2006 +0200
@@ -18,12 +18,12 @@
         try:
             self.twistd = twistedRequest
             self.reactor = reactor
-            
+
             # Copy headers
             self.http_accept_language = self.twistd.getHeader('Accept-Language')
             self.saved_cookie = self.twistd.getHeader('Cookie')
             self.http_user_agent = self.twistd.getHeader('User-Agent')
-            
+
             # Copy values from twisted request
             self.server_protocol = self.twistd.clientproto
             self.server_name = self.twistd.getRequestHostname().split(':')[0]
@@ -42,7 +42,7 @@
             self.setURL(self.twistd.getAllHeaders())
 
             ##self.debugEnvironment(twistedRequest.getAllHeaders())
-            
+
             RequestBase.__init__(self, properties)
 
         except MoinMoinFinish: # might be triggered by http_redirect
@@ -63,7 +63,7 @@
             self.fail(self.delayedError)
             return self.finish()
         RequestBase.run(self)
-            
+
     def setup_args(self, form=None):
         """ Return args dict 
         
@@ -73,12 +73,12 @@
         # TODO: check if for a POST this included query_string args (needed for
         # TwikiDraw's action=AttachFile&do=savedrawing)
         return self.decodeArgs(self.twistd.args)
-        
+
     def read(self, n=None):
         """ Read from input stream. """
         # XXX why is that wrong?:
         #rd = self.reactor.callFromThread(self.twistd.read)
-        
+
         # XXX do we need self.reactor.callFromThread with that?
         # XXX if yes, why doesn't it work?
         self.twistd.content.seek(0, 0)
@@ -88,7 +88,7 @@
             rd = self.twistd.content.read(n)
         #print "request.RequestTwisted.read: data=\n" + str(rd)
         return rd
-    
+
     def write(self, *data):
         """ Write to output stream. """
         #print "request.RequestTwisted.write: data=\n" + wd
@@ -153,4 +153,4 @@
 
     def setResponseCode(self, code, message=None):
         self.twistd.setResponseCode(code, message)
-        
+
--- a/MoinMoin/request/WSGI.py	Sun Jul 16 13:40:17 2006 +0200
+++ b/MoinMoin/request/WSGI.py	Sun Jul 16 13:51:22 2006 +0200
@@ -17,42 +17,42 @@
         try:
             self.env = env
             self.hasContentType = False
-            
+
             self.stdin = env['wsgi.input']
             self.stdout = StringIO.StringIO()
-            
+
             self.status = '200 OK'
             self.headers = []
-            
+
             self._setup_vars_from_std_env(env)
             RequestBase.__init__(self, {})
 
         except Exception, err:
             self.fail(err)
-    
+
     def setup_args(self, form=None):
         # TODO: does this include query_string args for POST requests?
         # see also how CGI works now
         if form is None:
             form = cgi.FieldStorage(fp=self.stdin, environ=self.env, keep_blank_values=1)
         return self._setup_args_from_cgi_form(form)
-    
+
     def read(self, n=None):
         if n is None:
             return self.stdin.read()
         else:
             return self.stdin.read(n)
-    
+
     def write(self, *data):
         self.stdout.write(self.encode(data))
-    
+
     def reset_output(self):
         self.stdout = StringIO.StringIO()
-    
+
     def setHttpHeader(self, header):
         if type(header) is unicode:
             header = header.encode('ascii')
-        
+
         key, value = header.split(':', 1)
         value = value.lstrip()
         if key.lower() == 'content-type':
@@ -62,27 +62,27 @@
                 return
             else:
                 self.hasContentType = True
-        
+
         elif key.lower() == 'status':
             # save status for finish
             self.status = value
             return
-            
+
         self.headers.append((key, value))
-    
+
     def http_headers(self, more_headers=[]):
         for header in more_headers:
             self.setHttpHeader(header)
-        
+
         if not self.hasContentType:
             self.headers.insert(0, ('Content-Type', 'text/html;charset=%s' % config.charset))
-    
+
     def flush(self):
         pass
-    
+
     def finish(self):
         pass
-    
+
     def output(self):
         return self.stdout.getvalue()