aboutsummaryrefslogtreecommitdiff
path: root/src/ee/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/tools')
-rw-r--r--src/ee/tools/import_parts_yaml.py8
-rw-r--r--src/ee/tools/init.py10
2 files changed, 14 insertions, 4 deletions
diff --git a/src/ee/tools/import_parts_yaml.py b/src/ee/tools/import_parts_yaml.py
index 81a23f8..d13907e 100644
--- a/src/ee/tools/import_parts_yaml.py
+++ b/src/ee/tools/import_parts_yaml.py
@@ -4,7 +4,7 @@ import yaml
from pathlib import Path
from ee.part import PartDb, save_db
-from ee.xml import bomFile
+from ee.xml import types
def import_parts_yaml(in_file: Path, out_dir: Path):
@@ -20,15 +20,15 @@ def import_parts_yaml(in_file: Path, out_dir: Path):
print("Bad YAML document, each part must be a dict", file=sys.stderr)
return
- part_number_list = bomFile.PartNumberList()
+ part_number_list = types.PartNumberList()
mpn = item.get("mpn")
assert isinstance(mpn, str)
- part_number_list.part_number.append(bomFile.PartNumber(value=mpn))
+ part_number_list.part_number.append(types.PartNumber(value=mpn))
id_ = mpn
- part = bomFile.Part(id=id_)
+ part = types.Part(id=id_)
part.part_numbersProp = part_number_list
parts.add_entry(part, True)
diff --git a/src/ee/tools/init.py b/src/ee/tools/init.py
new file mode 100644
index 0000000..a3e0472
--- /dev/null
+++ b/src/ee/tools/init.py
@@ -0,0 +1,10 @@
+import argparse
+from pathlib import Path
+
+from ee.project import init
+
+parser = argparse.ArgumentParser()
+
+args = parser.parse_args()
+
+init(Path("."))