comparison MoinMoin/request/request_modpython.py @ 2975:ea78a739b5ad

imported patch fix-modpython-patch (port from 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 05 Jan 2008 21:46:35 +0100
parents b902f2397c68
children 799875c9fe2d
comparison
equal deleted inserted replaced
2974:bc61a0470fd9 2975:ea78a739b5ad
10 from MoinMoin.request import RequestBase 10 from MoinMoin.request import RequestBase
11 11
12 class Request(RequestBase): 12 class Request(RequestBase):
13 """ specialized on mod_python requests """ 13 """ specialized on mod_python requests """
14 14
15 def __init__(self, req): 15 def __init__(self, req, properties={}):
16 """ Saves mod_pythons request and sets basic variables using 16 """ Saves mod_pythons request and sets basic variables using
17 the req.subprocess_env, cause this provides a standard 17 the req.subprocess_env, cause this provides a standard
18 way to access the values we need here. 18 way to access the values we need here.
19 19
20 @param req: the mod_python request instance 20 @param req: the mod_python request instance
31 if not hasattr(req.subprocess_env, 'get'): 31 if not hasattr(req.subprocess_env, 'get'):
32 env = dict(req.subprocess_env) 32 env = dict(req.subprocess_env)
33 else: 33 else:
34 env = req.subprocess_env 34 env = req.subprocess_env
35 self._setup_vars_from_std_env(env) 35 self._setup_vars_from_std_env(env)
36 RequestBase.__init__(self) 36 RequestBase.__init__(self, properties)
37 37
38 except Exception, err: 38 except Exception, err:
39 self.fail(err) 39 self.fail(err)
40 40
41 def fixURI(self, env): 41 def fixURI(self, env):
82 """ 82 """
83 from mod_python import util 83 from mod_python import util
84 form = util.FieldStorage(self.mpyreq) 84 form = util.FieldStorage(self.mpyreq)
85 85
86 args = {} 86 args = {}
87 for key in form: 87
88 # You cannot get rid of .keys() here
89 for key in form.keys():
88 if key is None: 90 if key is None:
89 continue 91 continue
90 values = form[key] 92 values = form[key]
91 if not isinstance(values, list): 93 if not isinstance(values, list):
92 values = [values] 94 values = [values]