# This is used by Environment to populate its env
# Due to circular dependencies it cannot reference other parts of bldr
import toml

def default(dotbldr_path: str) -> dict:
    dep = {
        'config': toml.load(f"{dotbldr_path}/dependency.toml"),
        'lock': toml.load(f"{dotbldr_path}/dependency.lock.toml")
    }
    return dep

def save_lock(dotbldr_path: str, lock_env: dict):
    with open(f"{dotbldr_path}/dependency.lock.toml", 'w') as toml_file:
        return toml.dump(lock_env, toml_file)

def save_config(dotbldr_path: str, config_env: dict):
    with open(f"{dotbldr_path}/dependency.toml", 'w') as toml_file:
        return toml.dump(config_env, toml_file)
[((204, 248), 'toml.load', 'toml.load', (['f"""{dotbldr_path}/dependency.toml"""'], {}), "(f'{dotbldr_path}/dependency.toml')\n", (213, 248), False, 'import toml\n'), ((266, 315), 'toml.load', 'toml.load', (['f"""{dotbldr_path}/dependency.lock.toml"""'], {}), "(f'{dotbldr_path}/dependency.lock.toml')\n", (275, 315), False, 'import toml\n'), ((476, 506), 'toml.dump', 'toml.dump', (['lock_env', 'toml_file'], {}), '(lock_env, toml_file)\n', (485, 506), False, 'import toml\n'), ((645, 677), 'toml.dump', 'toml.dump', (['config_env', 'toml_file'], {}), '(config_env, toml_file)\n', (654, 677), False, 'import toml\n')]