mercurial/hgweb/hgwebdir_mod.py
changeset 3415 ec6f400cff4d
parent 3365 cf680c9ab1dd
child 3473 2896ce093ec4
equal deleted inserted replaced
3414:9b1c126b74cd 3415:ec6f400cff4d
     6 # This software may be used and distributed according to the terms
     6 # This software may be used and distributed according to the terms
     7 # of the GNU General Public License, incorporated herein by reference.
     7 # of the GNU General Public License, incorporated herein by reference.
     8 
     8 
     9 import os
     9 import os
    10 from mercurial.demandload import demandload
    10 from mercurial.demandload import demandload
    11 demandload(globals(), "ConfigParser mimetools cStringIO")
    11 demandload(globals(), "mimetools cStringIO")
    12 demandload(globals(), "mercurial:ui,hg,util,templater")
    12 demandload(globals(), "mercurial:ui,hg,util,templater")
    13 demandload(globals(), "mercurial.hgweb.hgweb_mod:hgweb")
    13 demandload(globals(), "mercurial.hgweb.hgweb_mod:hgweb")
    14 demandload(globals(), "mercurial.hgweb.common:get_mtime,staticfile,style_map")
    14 demandload(globals(), "mercurial.hgweb.common:get_mtime,staticfile,style_map")
    15 from mercurial.i18n import gettext as _
    15 from mercurial.i18n import gettext as _
    16 
    16 
    28             self.repos_sorted = ('', False)
    28             self.repos_sorted = ('', False)
    29         elif isinstance(config, dict):
    29         elif isinstance(config, dict):
    30             self.repos = cleannames(config.items())
    30             self.repos = cleannames(config.items())
    31             self.repos.sort()
    31             self.repos.sort()
    32         else:
    32         else:
    33             cp = ConfigParser.SafeConfigParser()
    33             cp = util.configparser()
    34             cp.read(config)
    34             cp.read(config)
    35             self.repos = []
    35             self.repos = []
    36             if cp.has_section('web'):
    36             if cp.has_section('web'):
    37                 if cp.has_option('web', 'motd'):
    37                 if cp.has_option('web', 'motd'):
    38                     self.motd = cp.get('web', 'motd')
    38                     self.motd = cp.get('web', 'motd')