Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/request.py @ 26132:9df8c729e2e7
hgweb: add some documentation
It took longer than I wanted to grok how the various parts of hgweb
worked. So I added some class and method documentation to help whoever
hacks on this next.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 22 Aug 2015 13:58:59 -0700 |
parents | 328739ea70c3 |
children | 461e7b700fdf |
comparison
equal
deleted
inserted
replaced
26131:0a9009d56fea | 26132:9df8c729e2e7 |
---|---|
38 for k, v in form.iteritems(): | 38 for k, v in form.iteritems(): |
39 form[k] = [i.strip() for i in v] | 39 form[k] = [i.strip() for i in v] |
40 return form | 40 return form |
41 | 41 |
42 class wsgirequest(object): | 42 class wsgirequest(object): |
43 """Higher-level API for a WSGI request. | |
44 | |
45 WSGI applications are invoked with 2 arguments. They are used to | |
46 instantiate instances of this class, which provides higher-level APIs | |
47 for obtaining request parameters, writing HTTP output, etc. | |
48 """ | |
43 def __init__(self, wsgienv, start_response): | 49 def __init__(self, wsgienv, start_response): |
44 version = wsgienv['wsgi.version'] | 50 version = wsgienv['wsgi.version'] |
45 if (version < (1, 0)) or (version >= (2, 0)): | 51 if (version < (1, 0)) or (version >= (2, 0)): |
46 raise RuntimeError("Unknown and unsupported WSGI version %d.%d" | 52 raise RuntimeError("Unknown and unsupported WSGI version %d.%d" |
47 % version) | 53 % version) |