aboutsummaryrefslogtreecommitdiff
path: root/src/ee/tools
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-03-16 22:17:33 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2019-03-23 07:30:03 +0100
commit1fe278b37b4031a42f8e27ee4f3251b474efcb16 (patch)
treee89454d2f868b491ba27792cafb1db8266ff1bb0 /src/ee/tools
parent8e642991d557bd902b749ddd84e41d65c48f79cf (diff)
downloadee-python-1fe278b37b4031a42f8e27ee4f3251b474efcb16.tar.gz
ee-python-1fe278b37b4031a42f8e27ee4f3251b474efcb16.tar.bz2
ee-python-1fe278b37b4031a42f8e27ee4f3251b474efcb16.tar.xz
ee-python-1fe278b37b4031a42f8e27ee4f3251b474efcb16.zip
Starting some code around creating reports.
Diffstat (limited to 'src/ee/tools')
-rw-r--r--src/ee/tools/__init__.py6
-rw-r--r--src/ee/tools/create_order.py4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/ee/tools/__init__.py b/src/ee/tools/__init__.py
index 12916ca..b0c1051 100644
--- a/src/ee/tools/__init__.py
+++ b/src/ee/tools/__init__.py
@@ -1,4 +1,6 @@
import os.path
+from pathlib import Path
+from typing import Union
from colors import color
@@ -13,8 +15,8 @@ def _mkdir_and_open(path):
return open(path, "w")
-def mk_parents(path: str):
- dirname = os.path.diŒrname(path)
+def mk_parents(path: Union[str, Path]):
+ dirname = os.path.dirname(str(path))
if len(dirname) == 0:
return
diff --git a/src/ee/tools/create_order.py b/src/ee/tools/create_order.py
index 8941fcd..f493578 100644
--- a/src/ee/tools/create_order.py
+++ b/src/ee/tools/create_order.py
@@ -2,6 +2,7 @@ import argparse
from pathlib import Path
from ee.order import create_order
+from ee.project import Project
parser = argparse.ArgumentParser()
@@ -20,7 +21,8 @@ parser.add_argument("--part-db",
args = parser.parse_args()
+project = Project.load(Path("."))
part_db_dirs = [Path(part_db) for part_db in args.part_db]
fail_on_missing_parts = False
-create_order(Path(args.schematic), Path(args.out), part_db_dirs, fail_on_missing_parts)
+create_order(project, Path(args.schematic), Path(args.out), part_db_dirs, fail_on_missing_parts)