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) |