aboutsummaryrefslogtreecommitdiff
path: root/src/ee/part
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/part')
-rw-r--r--src/ee/part/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ee/part/__init__.py b/src/ee/part/__init__.py
index cf60dd5..d4d99ac 100644
--- a/src/ee/part/__init__.py
+++ b/src/ee/part/__init__.py
@@ -81,7 +81,9 @@ def save_db(dir_path: Path, db: PartDb):
idx_path = dir_path / "index.xml"
if not idx_path.is_file():
- raise EeException("The given db directory exists, but does not look like a part db dir")
+ # Ninja creates the parent directories out the output..
+ if len(list(dir_path.iterdir())) > 0:
+ raise EeException("The given db directory exists, but does not look like a part db dir")
for p in dir_path.iterdir():
if not p.is_file():
@@ -100,7 +102,7 @@ def save_db(dir_path: Path, db: PartDb):
for part in parts:
id_ = part.id
- path = dir_path / "{}.xml".format(id_)
+ path = dir_path / "{}.xml".format(id_.replace("/", "_"))
with path.open("w") as f:
part.export(outfile=f, level=0, name_=find_root_tag(part))