comparison mercurial/hgweb/hgwebdir_mod.py @ 4051:022056263354

hgwebdir: class hgwebdir should also accept a configparser instance
author Michael Gebetsroither <michael.geb@gmx.at>
date Tue, 30 Jan 2007 22:07:22 +0100
parents 79e5a6e7c451
children e6d26e71f049
comparison
equal deleted inserted replaced
4050:75313c36aa04 4051:022056263354
27 self.repos_sorted = ('', False) 27 self.repos_sorted = ('', False)
28 elif isinstance(config, dict): 28 elif isinstance(config, dict):
29 self.repos = cleannames(config.items()) 29 self.repos = cleannames(config.items())
30 self.repos.sort() 30 self.repos.sort()
31 else: 31 else:
32 cp = util.configparser() 32 if isinstance(config, util.configparser):
33 cp.read(config) 33 cp = config
34 else:
35 cp = util.configparser()
36 cp.read(config)
34 self.repos = [] 37 self.repos = []
35 if cp.has_section('web'): 38 if cp.has_section('web'):
36 if cp.has_option('web', 'motd'): 39 if cp.has_option('web', 'motd'):
37 self.motd = cp.get('web', 'motd') 40 self.motd = cp.get('web', 'motd')
38 if cp.has_option('web', 'style'): 41 if cp.has_option('web', 'style'):