Exemplo n.º 1
0
def load_graphs(props_dir):
    pd = Path(props_dir)
    props = Properties()
    for this_file in pd.iterdir():
        if (this_file.is_file()):
            with open(this_file, "rb") as f:
                props.load(f, "utf-8")
                props.reset()
    return props
def change_config(config_remote, config_file, fn):
    from jproperties import Properties
    read_props = Properties()
    write_props = Properties()

    if config_file is None:
        return
    with open(config_file, "r") as file:
        read_props.load(file)
    write_props = copy_exist(write_props, read_props)
    write_props = fn(write_props, read_props, config_remote)
    with open(config_file, "w") as wfile:
        write_props.reset()
        write_props.store(wfile)