Commit b525ba4f authored by Eric Duminil's avatar Eric Duminil
Browse files

Change priority order

parent 4b445377
......@@ -251,13 +251,10 @@ def _is_in_proj_folder(path: Path) -> bool:
def _resolve_project(citygml_path: Path, project_path: Path | None) -> tuple[Path, str]:
"""Return (project_path, citygml_filename) based on CityGML location.
- project_path given: copy CityGML there if not already present (takes priority).
- CityGML inside a .proj folder: use parent as project, reference by name.
- project_path given: copy CityGML there if not already present.
- Neither: create a temporary repository under /tmp (not auto-cleaned).
"""
if _is_in_proj_folder(citygml_path):
return citygml_path.parent, citygml_path.name
if project_path is not None:
project_path.mkdir(exist_ok=True, parents=True)
dest = project_path / citygml_path.name
......@@ -266,6 +263,9 @@ def _resolve_project(citygml_path: Path, project_path: Path | None) -> tuple[Pat
log.info("Copied %s to %s", citygml_path.name, project_path)
return project_path, citygml_path.name
if _is_in_proj_folder(citygml_path):
return citygml_path.parent, citygml_path.name
tmp_proj = SIMSTADT_TEMP_REPO / (citygml_path.stem + ".proj")
tmp_proj.mkdir(parents=True, exist_ok=True)
dest = tmp_proj / citygml_path.name
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment