Exemplo n.º 1
0
def peer_overwrites_cmd(pack):
    args = ['--ovr']
    for [ovr, other] in pack:
        conf = peer_config.PeerConfig(peer_id=other['peer_id'])
        cfg_parser = peer_config_parser.parser('python')
        cfg_parser.parse(ovr, conf)
        args += ['--peer', other['peer_id']]
        ser = peer_config_serializer.PeerConfigSerializerCmd()
        ser.serialize(conf, args)
        if other['config_file']:
            for f in other['config_file']:
                args +=  ['-f', f]
    return args
Exemplo n.º 2
0
def peer_overwrites_cmd(pack):
    args = ['--ovr']
    for [ovr, other] in pack:
        conf = peer_config.PeerConfig(peer_id=other['peer_id'])
        cfg_parser = peer_config_parser.parser('python')
        cfg_parser.parse(ovr, conf)
        args += ['--peer', other['peer_id']]
        ser = peer_config_serializer.PeerConfigSerializerCmd()
        ser.serialize(conf, args)
        if other['config_file']:
            for f in other['config_file']:
                args += ['-f', f]
    return args
Exemplo n.º 3
0
    def _load_provided_configs(self):

        # parse default config file
        self._load_config_base()

        self._load_defaults(CONFIG_DEFAULTS)
        # parse external config file
        self._load_config_external()

        # parse other config files (names from command line)
        for filename in self.file_list:
            self._load_config_from_file(filename, CONFIG_FILE_EXT, update=True)

        # parse overrides (from command line)
        dictparser = peer_config_parser.parser('python')
        dictparser.parse(self.cmd_overrides, self.core, update=True)
Exemplo n.º 4
0
    def _load_provided_configs(self):

        # parse default config file
        self._load_config_base()

        self._load_defaults(CONFIG_DEFAULTS)
        # parse external config file
        self._load_config_external()

        # parse other config files (names from command line)
        for filename in self.file_list:
            self._load_config_from_file(filename, CONFIG_FILE_EXT, update=True)

        # parse overrides (from command line)
        dictparser = peer_config_parser.parser('python')
        dictparser.parse(self.cmd_overrides, self.core, update=True)
Exemplo n.º 5
0
 def _load_config_from_file(self, p_path, p_type, update=False):
     with codecs.open(p_path, "r", "utf8") as f:
         parser = peer_config_parser.parser(p_type)
         parser.parse(f, self.core)
Exemplo n.º 6
0
 def _load_config_from_file(self, p_path, p_type, update=False):
     with codecs.open(p_path, "r", "utf8") as f:
         parser = peer_config_parser.parser(p_type)
         parser.parse(f, self.core)