59 else: |
59 else: |
60 self.ui = ui.ui() |
60 self.ui = ui.ui() |
61 self.ui.setconfig('ui', 'report_untrusted', 'off') |
61 self.ui.setconfig('ui', 'report_untrusted', 'off') |
62 self.ui.setconfig('ui', 'interactive', 'off') |
62 self.ui.setconfig('ui', 'interactive', 'off') |
63 |
63 |
64 self.motd = self.ui.config('web', 'motd') |
|
65 self.style = self.ui.config('web', 'style', 'paper') |
|
66 self.stripecount = self.ui.config('web', 'stripes', 1) |
|
67 if self.stripecount: |
|
68 self.stripecount = int(self.stripecount) |
|
69 self._baseurl = self.ui.config('web', 'baseurl') |
|
70 |
|
71 if not isinstance(self.conf, (dict, list, tuple)): |
64 if not isinstance(self.conf, (dict, list, tuple)): |
72 map = {'paths': 'hgweb-paths'} |
65 map = {'paths': 'hgweb-paths'} |
73 self.ui.readconfig(self.conf, remap=map, trust=True) |
66 self.ui.readconfig(self.conf, remap=map, trust=True) |
74 paths = self.ui.configitems('hgweb-paths') |
67 paths = self.ui.configitems('hgweb-paths') |
75 elif isinstance(self.conf, (list, tuple)): |
68 elif isinstance(self.conf, (list, tuple)): |
76 paths = self.conf |
69 paths = self.conf |
77 elif isinstance(self.conf, dict): |
70 elif isinstance(self.conf, dict): |
78 paths = self.conf.items() |
71 paths = self.conf.items() |
|
72 |
|
73 self.motd = self.ui.config('web', 'motd') |
|
74 self.style = self.ui.config('web', 'style', 'paper') |
|
75 self.stripecount = self.ui.config('web', 'stripes', 1) |
|
76 if self.stripecount: |
|
77 self.stripecount = int(self.stripecount) |
|
78 self._baseurl = self.ui.config('web', 'baseurl') |
79 |
79 |
80 self.repos = findrepos(paths) |
80 self.repos = findrepos(paths) |
81 for prefix, root in self.ui.configitems('collections'): |
81 for prefix, root in self.ui.configitems('collections'): |
82 prefix = util.pconvert(prefix) |
82 prefix = util.pconvert(prefix) |
83 for path in util.walkrepos(root, followsym=True): |
83 for path in util.walkrepos(root, followsym=True): |