(self, config_source)
return config
Parses a landslide configuration file and returns a normalized
            python dict.
Parses a landslide configuration file and returns a normalized
            python dict.
Parses a landslide configuration file and returns a normalized python dict .
def parse_config(self, config_source):
        """ Parses a landslide configuration file and returns a normalized
            python dict.
        """
        self.log(u"Config   %s" % config_source)
        try:
            raw_config = ConfigParser.RawConfigParser()
            raw_config.read(config_source)
        except Exception, e:
            raise RuntimeError(u"Invalid configuration file: %s" % e)
        config = {}
        config['source'] = raw_config.get('landslide', 'source')\
            .replace('\r', '').split('\n')
        if raw_config.has_option('landslide', 'theme'):
            config['theme'] = raw_config.get('landslide', 'theme')
            self.log(u"Using    configured theme %s" % config['theme'])
        if raw_config.has_option('landslide', 'destination'):
            config['destination'] = raw_config.get('landslide', 'destination')
        if raw_config.has_option('landslide', 'linenos'):
            config['linenos'] = raw_config.get('landslide', 'linenos')
        if raw_config.has_option('landslide', 'embed'):
            config['embed'] = raw_config.getboolean('landslide', 'embed')
        if raw_config.has_option('landslide', 'relative'):
            config['relative'] = raw_config.getboolean('landslide', 'relative')
        if raw_config.has_option('landslide', 'css'):
            config['css'] = raw_config.get('landslide', 'css')\
                .replace('\r', '').split('\n')
        if raw_config.has_option('landslide', 'js'):
            config['js'] = raw_config.get('landslide', 'js')\
                .replace('\r', '').split('\n')
        return config
def parse_config ( self , config_source ) : self . log ( u"Config   %s" % config_source ) try : raw_config = ConfigParser . RawConfigParser ( ) raw_config . read ( config_source ) except Exception , e : raise RuntimeError ( u"Invalid configuration file: %s" % e ) config = { } config [ 'source' ] = raw_config . get ( 'landslide' , 'source' ) . replace ( '\r' , '' ) . split ( '\n' ) if raw_config . has_option ( 'landslide' , 'theme' ) : config [ 'theme' ] = raw_config . get ( 'landslide' , 'theme' ) self . log ( u"Using    configured theme %s" % config [ 'theme' ] ) if raw_config . has_option ( 'landslide' , 'destination' ) : config [ 'destination' ] = raw_config . get ( 'landslide' , 'destination' ) if raw_config . has_option ( 'landslide' , 'linenos' ) : config [ 'linenos' ] = raw_config . get ( 'landslide' , 'linenos' ) if raw_config . has_option ( 'landslide' , 'embed' ) : config [ 'embed' ] = raw_config . getboolean ( 'landslide' , 'embed' ) if raw_config . has_option ( 'landslide' , 'relative' ) : config [ 'relative' ] = raw_config . getboolean ( 'landslide' , 'relative' ) if raw_config . has_option ( 'landslide' , 'css' ) : config [ 'css' ] = raw_config . get ( 'landslide' , 'css' ) . replace ( '\r' , '' ) . split ( '\n' ) if raw_config . has_option ( 'landslide' , 'js' ) : config [ 'js' ] = raw_config . get ( 'landslide' , 'js' ) . replace ( '\r' , '' ) . split ( '\n' ) return config