5 class formwrap(object):
6 def __init__(self, req):
7 if req.ihead.get("Content-Type") == "application/x-www-form-urlencoded":
8 self.cf = cgi.parse(environ = req.env, fp = req.env["wsgi.input"])
10 self.cf = cgi.parse(environ = req.env)
12 def __getitem__(self, key):
13 return self.cf[key][0]
15 def get(self, key, default = ""):
17 return self.cf[key][0]
20 def __contains__(self, key):
21 return key in self.cf and len(self.cf[key]) > 0
28 for key, list in self.cf.items():
37 return [val for key, val in self.items()]
40 return req.item(formwrap)