aboutsummaryrefslogtreecommitdiff
path: root/src/ee/order
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-03-15 07:58:06 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2019-03-15 08:30:07 +0100
commitb67aa2b41247991e361dec0963670b4e5108410a (patch)
tree67591b0f4cc6e767d0097c1afc3f08ad40ee19ea /src/ee/order
parent8d17fb5bc4b0dae0758e01a44d77d87acf2e686a (diff)
downloadee-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/order')
-rw-r--r--src/ee/order/__init__.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ee/order/__init__.py b/src/ee/order/__init__.py
index 7c815b4..368ea7a 100644
--- a/src/ee/order/__init__.py
+++ b/src/ee/order/__init__.py
@@ -3,18 +3,18 @@ from pathlib import Path
from typing import List, Tuple
from ee.part import PartDb, load_db, save_db
-from ee.xml import bomFile, bom_file_utils
+from ee.xml import types, bom_file_utils
__all__ = ["create_order"]
@total_ordering
class PartInfo(object):
- def __init__(self, part: bomFile.Part):
+ def __init__(self, part: types.Part):
self.part = part
self.id = part.id
self.pn = bom_file_utils.find_pn(part)
- self.available_from: List[Tuple[str, bomFile.Part]] = []
+ self.available_from: List[Tuple[str, types.Part]] = []
def __lt__(self, other: "PartInfo"):
return self.part.idProp == other.part.idProp
@@ -41,10 +41,10 @@ def create_order(schematic_dir: Path, out_dir: Path, part_db_dirs: List[Path], f
info.available_from.append((distributor, p))
for sch_pn_ in bom_file_utils.part_numbers(info.part):
- sch_pn: bomFile.PartNumber = sch_pn_
+ sch_pn: types.PartNumber = sch_pn_
for p_pn_ in bom_file_utils.part_numbers(p):
- p_pn: bomFile.PartNumber = p_pn_
+ p_pn: types.PartNumber = p_pn_
if sch_pn.distributorProp == p_pn.distributorProp and sch_pn.value == p_pn.value:
if p.idProp not in info.available_from:
@@ -69,9 +69,9 @@ def create_order(schematic_dir: Path, out_dir: Path, part_db_dirs: List[Path], f
return False
for info in infos:
- part = bomFile.Part(id=info.part.id,
+ part = types.Part(id=info.part.id,
schema_reference=info.part.schema_reference,
- part_numbers=bomFile.PartNumberList())
+ part_numbers=types.PartNumberList())
part_numbers = part.part_numbersProp.part_number
@@ -80,7 +80,7 @@ def create_order(schematic_dir: Path, out_dir: Path, part_db_dirs: List[Path], f
distributor, distributor_part = info.available_from[0]
- part_numbers.append(bomFile.PartNumber(value=distributor_part.id, distributor=distributor))
+ part_numbers.append(types.PartNumber(value=distributor_part.id, distributor=distributor))
out_parts.add_entry(part, True)