aboutsummaryrefslogtreecommitdiff
path: root/src/ee/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/tools')
-rw-r--r--src/ee/tools/create_order.py2
-rw-r--r--src/ee/tools/digikey_normalize_facts.py4
-rw-r--r--src/ee/tools/digikey_search_parts.py9
-rw-r--r--src/ee/tools/element14_search_parts.py8
-rw-r--r--src/ee/tools/import_parts_yaml.py6
-rw-r--r--src/ee/tools/kicad_make_bom.py3
-rw-r--r--src/ee/tools/part_create_distributor_search_list.py8
-rw-r--r--src/ee/tools/templates/build.ninja.j250
8 files changed, 40 insertions, 50 deletions
diff --git a/src/ee/tools/create_order.py b/src/ee/tools/create_order.py
index e0bed58..8ca7e05 100644
--- a/src/ee/tools/create_order.py
+++ b/src/ee/tools/create_order.py
@@ -12,7 +12,7 @@ parser.add_argument("--schematic",
parser.add_argument("--out",
required=True,
- metavar="DIR")
+ metavar="PART DB")
parser.add_argument("--part-db",
nargs="*",
diff --git a/src/ee/tools/digikey_normalize_facts.py b/src/ee/tools/digikey_normalize_facts.py
index 07cc0d7..decf435 100644
--- a/src/ee/tools/digikey_normalize_facts.py
+++ b/src/ee/tools/digikey_normalize_facts.py
@@ -8,11 +8,11 @@ parser = argparse.ArgumentParser()
parser.add_argument("--in",
dest="in_",
required=True,
- metavar="FILE")
+ metavar="PART DB")
parser.add_argument("--out",
required=True,
- metavar="FILE")
+ metavar="PART DB")
args = parser.parse_args()
diff --git a/src/ee/tools/digikey_search_parts.py b/src/ee/tools/digikey_search_parts.py
index 07c3017..9f35e33 100644
--- a/src/ee/tools/digikey_search_parts.py
+++ b/src/ee/tools/digikey_search_parts.py
@@ -6,17 +6,16 @@ from ee.digikey.search_parts import search_parts
parser = argparse.ArgumentParser()
parser.add_argument("--in",
- dest="in_",
+ dest="in_path",
required=True,
- metavar="FILE")
+ metavar="PART DB")
parser.add_argument("--out",
required=True,
- metavar="FILE")
+ metavar="PART DB")
args = parser.parse_args()
cache_dir = ".ee/cache/digikey"
-force = True
-search_parts(Path(args.in_), Path(args.out), Path(cache_dir), force)
+search_parts(Path(args.in_path), Path(args.out), Path(cache_dir))
diff --git a/src/ee/tools/element14_search_parts.py b/src/ee/tools/element14_search_parts.py
index a4793c5..11fd3e1 100644
--- a/src/ee/tools/element14_search_parts.py
+++ b/src/ee/tools/element14_search_parts.py
@@ -8,13 +8,13 @@ from ee.element14.search_parts import search_parts
parser = argparse.ArgumentParser()
parser.add_argument("--in",
- dest="in_",
+ dest="in_path",
required=True,
- metavar="FILE")
+ metavar="PART DB")
parser.add_argument("--out",
required=True,
- metavar="FILE")
+ metavar="PART DB")
args = parser.parse_args()
@@ -27,4 +27,4 @@ e14_config = Element14Config(
api_key=config.get("element14", "api-key", fallback=None)
)
-search_parts(Path(args.in_), Path(args.out), Path(cache_dir), e14_config)
+search_parts(Path(args.in_path), Path(args.out), Path(cache_dir), e14_config)
diff --git a/src/ee/tools/import_parts_yaml.py b/src/ee/tools/import_parts_yaml.py
index d13907e..9b8e3bf 100644
--- a/src/ee/tools/import_parts_yaml.py
+++ b/src/ee/tools/import_parts_yaml.py
@@ -39,14 +39,14 @@ def import_parts_yaml(in_file: Path, out_dir: Path):
parser = argparse.ArgumentParser()
parser.add_argument("--in",
- dest="in_",
+ dest="in_path",
required=True,
metavar="PARTS_YAML")
parser.add_argument("--out",
required=True,
- metavar="PART_ DB")
+ metavar="PART DB")
args = parser.parse_args()
-import_parts_yaml(Path(args.in_), Path(args.out))
+import_parts_yaml(Path(args.in_path), Path(args.out))
diff --git a/src/ee/tools/kicad_make_bom.py b/src/ee/tools/kicad_make_bom.py
index c4a1dd8..60509a3 100644
--- a/src/ee/tools/kicad_make_bom.py
+++ b/src/ee/tools/kicad_make_bom.py
@@ -13,8 +13,7 @@ parser.add_argument("--sch",
help="The schematic to read")
parser.add_argument("--out",
- metavar="FILE",
- help="The output file")
+ metavar="PART DB")
parser.add_argument("--strategy",
metavar="FUNC")
diff --git a/src/ee/tools/part_create_distributor_search_list.py b/src/ee/tools/part_create_distributor_search_list.py
index 22b4c3f..273b6d3 100644
--- a/src/ee/tools/part_create_distributor_search_list.py
+++ b/src/ee/tools/part_create_distributor_search_list.py
@@ -6,14 +6,14 @@ from ee.part.create_distributor_search_list import create_distributor_search_lis
parser = argparse.ArgumentParser()
parser.add_argument("--in",
- dest="in_",
+ dest="in_path",
required=True,
- metavar="FILE")
+ metavar="PART DB")
parser.add_argument("--out",
required=True,
- metavar="FILE")
+ metavar="PART DB")
args = parser.parse_args()
-create_distributor_search_list(Path(args.in_), Path(args.out))
+create_distributor_search_list(Path(args.in_path), Path(args.out))
diff --git a/src/ee/tools/templates/build.ninja.j2 b/src/ee/tools/templates/build.ninja.j2
index e91de6c..8552d96 100644
--- a/src/ee/tools/templates/build.ninja.j2
+++ b/src/ee/tools/templates/build.ninja.j2
@@ -13,36 +13,36 @@ rule kicad-gerber
# mv $(GERBER_DIR)/tmp.zip $@
rule kicad-make-bom
- description = kicad-make-bom $out_dir
- command = $ee kicad-make-bom --sch $sch --out $out_dir $strategy
+ description = kicad-make-bom $out
+ command = $ee kicad-make-bom --sch $sch --out $out $strategy
rule part-create-distributor-search-list
- description = part-create-distributor-search-list distributor=$distributor $in_dir => $out_dir
- command = $ee part-create-distributor-search-list --in $in_dir --out $out_dir
+ description = part-create-distributor-search-list distributor: $distributor
+ command = $ee part-create-distributor-search-list --in $in --out $out
rule digikey-search-parts
description = digikey-search-parts
- command = $ee digikey-search-parts --in $in_dir --out $out_dir
+ command = $ee digikey-search-parts --in $in --out $out
rule digikey-normalize-facts
description = digikey-normalize-facts
- command = $ee digikey-normalize-facts --in $in_dir --out $out_dir
+ command = $ee digikey-normalize-facts --in $in --out $out
rule element14-search-parts
description = element14-search-parts
- command = $ee element14-search-parts --in $in_dir --out $out_dir
+ command = $ee element14-search-parts --in $in --out $out
rule element14-normalize-facts
description = element14-normalize-facts
- command = $ee element14-normalize-facts --in $in_dir --out $out_dir
+ command = $ee element14-normalize-facts --in $in --out $out
rule create-order
description = create-order
- command = $ee create-order --schematic $sch_dir --part-db $part_dbs --out $out_dir
+ command = $ee create-order --schematic $schematic --part-db $part_dbs --out $out
rule import-parts-yaml
description = import-parts-yaml $in
- command = $ee import-parts-yaml --in $in --out $out_dir
+ command = $ee import-parts-yaml --in $in --out $out
{% if gerber_zip is defined %}
build gerbers: phony {{ gerber_zip }}
@@ -50,37 +50,29 @@ build {{ gerber_zip }}: kicad-gerber $pcb
gerber_dir = {{ gerber_zip | parent_dir }}
{%- endif %}
-build ee/sch/index.xml: kicad-make-bom $sch
- out_dir = ee/sch
+build ee/sch.xml: kicad-make-bom $sch
strategy = {{ "--strategy " + kicad_bom_strategy if kicad_bom_strategy else "" }}
{%- for d in distributors %}
# Distributor {{ d }}
-build ee/{{ d }}/search-list/index.xml: part-create-distributor-search-list ee/sch/index.xml
- in_dir = ee/sch
- out_dir = ee/{{ d }}/search-list
+build ee/{{ d }}/search-list.xml: part-create-distributor-search-list ee/sch.xml
+ distributor = {{ d }}
-build ee/{{ d }}/downloaded/index.xml: {{ d }}-search-parts ee/{{ d }}/search-list/index.xml
- in_dir = ee/{{ d }}/search-list
- out_dir = ee/{{ d }}/downloaded
+build ee/{{ d }}/downloaded.xml: {{ d }}-search-parts ee/{{ d }}/search-list.xml
-build ee/{{ d }}/normalized/index.xml: {{ d }}-normalize-facts ee/{{ d }}/downloaded/index.xml
- in_dir = ee/{{ d }}/downloaded
- out_dir = ee/{{ d }}/normalized
+build ee/{{ d }}/normalized.xml: {{ d }}-normalize-facts ee/{{ d }}/downloaded.xml
-default ee/{{ d }}/normalized/index.xml
+default ee/{{ d }}/normalized.xml
{%- endfor %}
{%- for f in parts_yaml_files %}
-{% set out=(f | parent_dir) / (f | noext) / "index.xml" %}
+{% set out=(f | parent_dir) / ((f | noext) + ".xml") %}
build {{ out }}: import-parts-yaml {{ f }}
- out_dir = {{ f | parent_dir }}/{{ f | noext }}
# default {{ out }}
{% endfor %}
-build ee/order/index.xml: create-order ee/sch/index.xml {%- for p in part_dbs %} {{ p / "index.xml" }}{% endfor %}
- sch_dir = ee/sch
- out_dir = ee/order
- part_dbs ={%- for p in part_dbs %} {{ p }}{% endfor %}
+build ee/order.xml: create-order ee/sch.xml {%- for p in part_dbs %} {{ p }}.xml{% endfor %}
+ schematic = ee/sch.xml
+ part_dbs ={%- for p in part_dbs %} {{ p }}.xml{% endfor %}
-default ee/order/index.xml
+default ee/order.xml