allow uuid keyword in toml file
This commit is contained in:
parent
02a0b3d7d2
commit
88662ddabd
1 changed files with 10 additions and 2 deletions
|
@ -11,7 +11,7 @@ the import of projects via TOML.
|
||||||
import tomllib as toml
|
import tomllib as toml
|
||||||
import shutil
|
import shutil
|
||||||
from .input import sfcf
|
from .input import sfcf
|
||||||
from .main import import_project
|
from .main import import_project, update_aliases
|
||||||
from .meas_io import write_measurement
|
from .meas_io import write_measurement
|
||||||
import datalad.api as dl
|
import datalad.api as dl
|
||||||
import os
|
import os
|
||||||
|
@ -58,7 +58,15 @@ def import_toml(path: str, file: str, copy_file: bool=True) -> None:
|
||||||
project: dict = toml_dict['project']
|
project: dict = toml_dict['project']
|
||||||
measurements: dict = toml_dict['measurements']
|
measurements: dict = toml_dict['measurements']
|
||||||
check_measurement_data(measurements)
|
check_measurement_data(measurements)
|
||||||
uuid = import_project(path, project['url'], aliases = project.get('aliases', None))
|
aliases = project.get('aliases', None)
|
||||||
|
uuid = project.get('uuid', None)
|
||||||
|
if uuid is not None:
|
||||||
|
if not os.path.exists(path + "/projects/" + uuid):
|
||||||
|
uuid = import_project(path, project['url'], aliases=aliases)
|
||||||
|
else:
|
||||||
|
update_aliases(path, uuid, aliases)
|
||||||
|
else:
|
||||||
|
uuid = import_project(path, project['url'], aliases=aliases)
|
||||||
for mname, md in measurements.items():
|
for mname, md in measurements.items():
|
||||||
print("Import measurement: " + mname)
|
print("Import measurement: " + mname)
|
||||||
ensemble = md['ensemble']
|
ensemble = md['ensemble']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue