From 7af22b04ecdb9d012e5929c2f273dad5cd40bf20 Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann Date: Mon, 26 Aug 2024 14:17:10 +0000 Subject: [PATCH] better print statements, implement update project function --- corrlib/toml.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/corrlib/toml.py b/corrlib/toml.py index 2e8bdc0..68fbaf6 100644 --- a/corrlib/toml.py +++ b/corrlib/toml.py @@ -66,8 +66,9 @@ def import_toml(path, file, copy_file=True): if copy_file: import_file = os.path.join(path, "toml_imports", uuid, file) shutil.copy(file, import_file) - dl.save(path + import_file, message="Import using " + import_file, dataset=path) - print("Imported project, file copied to " + import_file) + dl.save(import_file, message="Import using " + import_file, dataset=path) + print("File copied to " + import_file) + print("Imported project.") return @@ -87,3 +88,8 @@ def reimport_project(path, uuid): for fname in filenames: import_toml(path, os.path.join(config_path, fname), copy_file=False) return + + +def update_project(path, uuid): + dl.update(os.path.join(path, "projects", uuid), how='merge', follow='parentds') + reimport_project(path, uuid)