Example #1
0
def create_config():
    options = parse_arguments()

    # 1) read the default config at "~/.ethereum"
    config = konfig.read_config()

    # 2) read config from file
    cfg_fn = getattr(options, 'config_file')
    if cfg_fn:
        if not os.path.exists(cfg_fn):
            konfig.read_config(cfg_fn)  # creates default
        config.read(cfg_fn)

    # 3) apply cmd line options to config
    for section in config.sections():
        for a, v in config.items(section):
            if getattr(options, a, None) is not None:
                config.set(section, a, getattr(options, a))

    konfig.validate_config(config)
    return config
Example #2
0
def create_config():
    options = parse_arguments()

    # 1) read the default config at "~/.ethereum"
    config = konfig.read_config()

    # 2) read config from file
    cfg_fn = getattr(options, 'config_file')
    if cfg_fn:
        if not os.path.exists(cfg_fn):
            konfig.read_config(cfg_fn)  # creates default
        config.read(cfg_fn)

    # 3) apply cmd line options to config
    for section in config.sections():
        for a, v in config.items(section):
            if getattr(options, a, None) is not None:
                config.set(section, a, getattr(options, a))

    konfig.validate_config(config)
    return config
Example #3
0
def create_config():
    options = parse_arguments()

    # 1) read the default config at "~/.ethereum"
    config = konfig.read_config()

    # 2) read config from file
    if getattr(options, 'config_file'):
        config.read(getattr(options, 'config_file'))

    # 3) apply cmd line options to config
    for section in config.sections():
        for a,v in config.items(section):
            if getattr(options, a, None) is not None:
                config.set(section, a, getattr(options,a))

    return config
Example #4
0
def create_config():
    options = parse_arguments()

    # 1) read the default config at "~/.ethereum"
    config = konfig.read_config()

    # 2) read config from file
    if getattr(options, 'config_file'):
        config.read(getattr(options, 'config_file'))

    # 3) apply cmd line options to config
    for section in config.sections():
        for a, v in config.items(section):
            if getattr(options, a, None) is not None:
                config.set(section, a, getattr(options, a))

    return config