aboutsummaryrefslogtreecommitdiff
path: root/src/ee/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/tools')
-rw-r--r--src/ee/tools/drawio_decompress.py2
-rw-r--r--src/ee/tools/drawio_to_parts.py (renamed from src/ee/tools/drawio-to-parts.py)9
-rw-r--r--src/ee/tools/templates/build.ninja.j29
3 files changed, 17 insertions, 3 deletions
diff --git a/src/ee/tools/drawio_decompress.py b/src/ee/tools/drawio_decompress.py
index 8949eec..8fafd54 100644
--- a/src/ee/tools/drawio_decompress.py
+++ b/src/ee/tools/drawio_decompress.py
@@ -18,7 +18,7 @@ in_stream = out_stream = None
try:
in_stream = open(args.in_path, "rb") if args.in_path else sys.stdin
- out_stream = open(args.out, "wr") if args.out else sys.stdout
+ out_stream = open(args.out, "w") if args.out else sys.stdout
decompress(in_stream, out_stream)
except IOError:
diff --git a/src/ee/tools/drawio-to-parts.py b/src/ee/tools/drawio_to_parts.py
index 562e341..671aaea 100644
--- a/src/ee/tools/drawio-to-parts.py
+++ b/src/ee/tools/drawio_to_parts.py
@@ -14,7 +14,12 @@ parser.add_argument("--out",
required=True,
metavar="PART DB")
+parser.add_argument("--parts",
+ nargs="*",
+ metavar="PART DB")
+
args = parser.parse_args()
-# ee.drawio.to_parts(Path(args.in_path), Path(args.out))
-ee.drawio.to_dot(Path(args.in_path), Path(args.out))
+parts = args.parts or []
+ee.drawio.to_parts(Path(args.in_path), Path(args.out), [Path(path) for path in parts])
+# ee.drawio.to_dot(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 d62f350..b9a65df 100644
--- a/src/ee/tools/templates/build.ninja.j2
+++ b/src/ee/tools/templates/build.ninja.j2
@@ -53,6 +53,15 @@ rule import-parts-yaml
description = import-parts-yaml $in
command = $ee import-parts-yaml --in $in --out $out
+rule drawio-decompress
+ command = $ee drawio-decompress --in $in --out $out
+
+rule drawio-to-parts
+ command = $ee drawio-to-parts --in $in --out $out $args
+
+rule part-from-excel
+ command = $ee part-from-excel --in $in --out $out --sheet "$sheet"
+
{% if gerber_zip is defined %}
build gerbers: phony {{ gerber_zip }}
build {{ gerber_zip }}: kicad-gerber $pcb