diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2019-03-15 07:58:06 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-03-15 08:30:07 +0100 |
commit | b67aa2b41247991e361dec0963670b4e5108410a (patch) | |
tree | 67591b0f4cc6e767d0097c1afc3f08ad40ee19ea /src/ee/tools | |
parent | 8d17fb5bc4b0dae0758e01a44d77d87acf2e686a (diff) | |
download | ee-python-b67aa2b41247991e361dec0963670b4e5108410a.tar.gz ee-python-b67aa2b41247991e361dec0963670b4e5108410a.tar.bz2 ee-python-b67aa2b41247991e361dec0963670b4e5108410a.tar.xz ee-python-b67aa2b41247991e361dec0963670b4e5108410a.zip |
o Merging XSD files into one.
Diffstat (limited to 'src/ee/tools')
-rw-r--r-- | src/ee/tools/import_parts_yaml.py | 8 | ||||
-rw-r--r-- | src/ee/tools/init.py | 10 |
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(".")) |