comparison mercurial/hgweb/hgwebdir_mod.py @ 12690:94e7bd38d9a3

hgwebdir_mod: use fake termwidth to avoid mod_wsgi's wrath
author Augie Fackler <durin42@gmail.com>
date Sun, 10 Oct 2010 10:07:17 -0500
parents 9617803b1acb
children 1b1a9038a71a
comparison
equal deleted inserted replaced
12689:c52c629ce19e 12690:94e7bd38d9a3
39 if prefix: 39 if prefix:
40 name = prefix + '/' + name 40 name = prefix + '/' + name
41 repos.append((name, path)) 41 repos.append((name, path))
42 return repos 42 return repos
43 43
44 class wsgiui(ui.ui):
45 # default termwidth breaks under mod_wsgi
46 def termwidth(self):
47 return 80
48
44 class hgwebdir(object): 49 class hgwebdir(object):
45 refreshinterval = 20 50 refreshinterval = 20
46 51
47 def __init__(self, conf, baseui=None): 52 def __init__(self, conf, baseui=None):
48 self.conf = conf 53 self.conf = conf
56 return 61 return
57 62
58 if self.baseui: 63 if self.baseui:
59 u = self.baseui.copy() 64 u = self.baseui.copy()
60 else: 65 else:
61 u = ui.ui() 66 u = wsgiui()
62 u.setconfig('ui', 'report_untrusted', 'off') 67 u.setconfig('ui', 'report_untrusted', 'off')
63 u.setconfig('ui', 'interactive', 'off') 68 u.setconfig('ui', 'interactive', 'off')
64 69
65 if not isinstance(self.conf, (dict, list, tuple)): 70 if not isinstance(self.conf, (dict, list, tuple)):
66 map = {'paths': 'hgweb-paths'} 71 map = {'paths': 'hgweb-paths'}