aboutsummaryrefslogtreecommitdiff
path: root/src/ee/part
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/part')
-rw-r--r--src/ee/part/create_distributor_search_list.py11
-rw-r--r--src/ee/part/fact_keys.py2
2 files changed, 12 insertions, 1 deletions
diff --git a/src/ee/part/create_distributor_search_list.py b/src/ee/part/create_distributor_search_list.py
index fef1690..8d70e3e 100644
--- a/src/ee/part/create_distributor_search_list.py
+++ b/src/ee/part/create_distributor_search_list.py
@@ -1,10 +1,14 @@
from pathlib import Path
-from ee.part import PartDb, load_db, save_db, Part
+from ee.part import PartDb, load_db, save_db, Part, fact_keys
from ee.xml import types
__all__ = ["create_distributor_search_list"]
+ignored_part_classes = [
+ "mechanical"
+]
+
def create_distributor_search_list(in_path: Path, out_path: Path):
in_parts = load_db(in_path)
@@ -16,6 +20,11 @@ def create_distributor_search_list(in_path: Path, out_path: Path):
part = Part(xml)
pn_value = next((p.valueProp for p in part.get_mpns()), None)
+ part_class = part.find_fact(fact_keys.part_class)
+ if part_class:
+ if part_class.valueProp in ignored_part_classes:
+ continue
+
if pn_value is None:
refs = [ref.referenceProp for ref in part.get_schematic_references()]
print("Skipping part with no part number: schematic reference: {}".format(", ".join(refs)))
diff --git a/src/ee/part/fact_keys.py b/src/ee/part/fact_keys.py
index 5ca3c5b..f1f02c5 100644
--- a/src/ee/part/fact_keys.py
+++ b/src/ee/part/fact_keys.py
@@ -11,3 +11,5 @@ value = "http://purl.org/ee/fact-type/value"
place_part = "http://purl.org/ee/fact-type/place-part"
imperial_footprint_size = "http://purl.org/ee/fact-type/imperial-footprint-size"
+
+part_class = "http://purl.org/ee/fact-type/part-class"