Show More
@@ -15,12 +15,12 b' from common import ErrorResponse, get_mt' | |||
|
15 | 15 | from hgweb_mod import hgweb |
|
16 | 16 | from request import wsgirequest |
|
17 | 17 | |
|
18 | # This is a stopgap | |
|
18 | def cleannames(items): | |
|
19 | return [(util.pconvert(name).strip('/'), path) for name, path in items] | |
|
20 | ||
|
19 | 21 | class hgwebdir(object): |
|
22 | ||
|
20 | 23 | def __init__(self, conf, baseui=None): |
|
21 | def cleannames(items): | |
|
22 | return [(util.pconvert(name).strip('/'), path) | |
|
23 | for name, path in items] | |
|
24 | 24 | |
|
25 | 25 | if baseui: |
|
26 | 26 | self.ui = baseui.copy() |
@@ -31,9 +31,10 b' class hgwebdir(object):' | |||
|
31 | 31 | |
|
32 | 32 | self.motd = None |
|
33 | 33 | self.style = 'paper' |
|
34 |
self.stripecount = |
|
|
34 | self.stripecount = 1 | |
|
35 | 35 | self.repos_sorted = ('name', False) |
|
36 | 36 | self._baseurl = None |
|
37 | ||
|
37 | 38 | if isinstance(conf, (list, tuple)): |
|
38 | 39 | self.repos = cleannames(conf) |
|
39 | 40 | self.repos_sorted = ('', False) |
@@ -48,7 +49,7 b' class hgwebdir(object):' | |||
|
48 | 49 | self.repos = [] |
|
49 | 50 | self.motd = cp.get('web', 'motd') |
|
50 | 51 | self.style = cp.get('web', 'style', 'paper') |
|
51 | self.stripecount = cp.get('web', 'stripes') | |
|
52 | self.stripecount = cp.get('web', 'stripes', 1) | |
|
52 | 53 | self._baseurl = cp.get('web', 'baseurl') |
|
53 | 54 | if 'paths' in cp: |
|
54 | 55 | paths = cleannames(cp.items('paths')) |
@@ -310,12 +311,7 b' class hgwebdir(object):' | |||
|
310 | 311 | if not staticurl.endswith('/'): |
|
311 | 312 | staticurl += '/' |
|
312 | 313 | |
|
313 | style = self.style | |
|
314 | if style is None: | |
|
315 | style = config('web', 'style', '') | |
|
316 | if 'style' in req.form: | |
|
317 | style = req.form['style'][0] | |
|
318 | self.stripecount = int(self.stripecount or config('web', 'stripes', 1)) | |
|
314 | style = 'style' in req.form and req.form['style'][0] or self.style | |
|
319 | 315 | mapfile = templater.stylemap(style) |
|
320 | 316 | tmpl = templater.templater(mapfile, templatefilters.filters, |
|
321 | 317 | defaults={"header": header, |
General Comments 0
You need to be logged in to leave comments.
Login now