Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgweb_mod.py @ 8859:580a79dde2a3
hgweb: web.encoding should override encoding.encoding (issue1183)
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 20 Jun 2009 13:00:25 -0500 |
parents | 45f626a39def |
children | 36654238c050 |
comparison
equal
deleted
inserted
replaced
8858:16f6c13706df | 8859:580a79dde2a3 |
---|---|
62 self.maxchanges = int(self.config("web", "maxchanges", 10)) | 62 self.maxchanges = int(self.config("web", "maxchanges", 10)) |
63 self.stripecount = int(self.config("web", "stripes", 1)) | 63 self.stripecount = int(self.config("web", "stripes", 1)) |
64 self.maxshortchanges = int(self.config("web", "maxshortchanges", 60)) | 64 self.maxshortchanges = int(self.config("web", "maxshortchanges", 60)) |
65 self.maxfiles = int(self.config("web", "maxfiles", 10)) | 65 self.maxfiles = int(self.config("web", "maxfiles", 10)) |
66 self.allowpull = self.configbool("web", "allowpull", True) | 66 self.allowpull = self.configbool("web", "allowpull", True) |
67 self.encoding = self.config("web", "encoding", encoding.encoding) | 67 encoding.encoding = self.config("web", "encoding", |
68 encoding.encoding) | |
68 | 69 |
69 def run(self): | 70 def run(self): |
70 if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."): | 71 if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."): |
71 raise RuntimeError("This function is only intended to be " | 72 raise RuntimeError("This function is only intended to be " |
72 "called while running as a CGI script.") | 73 "called while running as a CGI script.") |
158 | 159 |
159 # process the web interface request | 160 # process the web interface request |
160 | 161 |
161 try: | 162 try: |
162 tmpl = self.templater(req) | 163 tmpl = self.templater(req) |
163 ctype = tmpl('mimetype', encoding=self.encoding) | 164 ctype = tmpl('mimetype', encoding=encoding.encoding) |
164 ctype = templater.stringify(ctype) | 165 ctype = templater.stringify(ctype) |
165 | 166 |
166 # check read permissions non-static content | 167 # check read permissions non-static content |
167 if cmd != 'static': | 168 if cmd != 'static': |
168 self.check_perm(req, None) | 169 self.check_perm(req, None) |
217 staticurl += '/' | 218 staticurl += '/' |
218 | 219 |
219 # some functions for the templater | 220 # some functions for the templater |
220 | 221 |
221 def header(**map): | 222 def header(**map): |
222 yield tmpl('header', encoding=self.encoding, **map) | 223 yield tmpl('header', encoding=encoding.encoding, **map) |
223 | 224 |
224 def footer(**map): | 225 def footer(**map): |
225 yield tmpl("footer", **map) | 226 yield tmpl("footer", **map) |
226 | 227 |
227 def motd(**map): | 228 def motd(**map): |