diff options
Diffstat (limited to 'src/ee/tools')
-rw-r--r-- | src/ee/tools/__init__.py | 6 | ||||
-rw-r--r-- | src/ee/tools/create_order.py | 4 |
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) |