diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-08-01 11:01:41 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-08-01 11:01:41 +0200 |
commit | 03bef0eb089de161b33d2f92783d1be5b06aa307 (patch) | |
tree | bc4322d9413a4c1d94f16fc395b7e47b7f0c2ec8 /demo | |
parent | 4896b414e70b7c537825ea3375915e1f46d1b9cd (diff) | |
download | ee-python-03bef0eb089de161b33d2f92783d1be5b06aa307.tar.gz ee-python-03bef0eb089de161b33d2f92783d1be5b06aa307.tar.bz2 ee-python-03bef0eb089de161b33d2f92783d1be5b06aa307.tar.xz ee-python-03bef0eb089de161b33d2f92783d1be5b06aa307.zip |
o Updating demo project, reorganizing the demo a bit.
o DataSetManager: renaming `add_ds` to `register_ds`.
Diffstat (limited to 'demo')
-rw-r--r-- | demo/doit/dodo.py | 61 |
1 files changed, 35 insertions, 26 deletions
diff --git a/demo/doit/dodo.py b/demo/doit/dodo.py index c2b8194..780f2b9 100644 --- a/demo/doit/dodo.py +++ b/demo/doit/dodo.py @@ -1,46 +1,55 @@ -import ee.bom.doit -import ee.digikey.doit -import ee.doit -import ee.kicad.doit -# noinspection PyUnresolvedReferences from ee.bom.doit import * -# noinspection PyUnresolvedReferences from ee.digikey.doit import * +from ee.doit import configure_logging from ee.ds import DataSetManager from ee.kicad.doit import * -prj = "demo" -sch = "{}.sch".format(prj) -kicad_pcb = "{}.kicad_pcb".format(prj) + +def configure_kicad(): + from ee.kicad.doit import doit_config, init + doit_config.configure(data_set_manager=dsm) + doit_config.append_in_data_set_for_task(task_kicad_create_component_data_set, kicad_footprint) + init(sch=sch, kicad_pcb=kicad_pcb, gerber_dir="gerber", ) + + +def configure_bom(): + from ee.bom.doit import doit_config + doit_config.configure(data_set_manager=dsm) + + +def configure_digikey(): + from ee.digikey.doit import doit_config + doit_config.configure(data_set_manager=dsm) + + +# Configure DoIt +configure_logging() DOIT_CONFIG = {'check_file_uptodate': 'timestamp'} -ee.doit.configure_logging() +prj = "demo" +sch = "{}.sch".format(prj) +kicad_pcb = "{}.kicad_pcb".format(prj) dsm = DataSetManager("ee") kicad_footprint = "kicad-footprint" -dsm.add_ds("csv", kicad_footprint, "kicad-footprint-mapping", path="ee/kicad-footprint.csv") - -ee.kicad.doit.doit_config.change_data_sets_for_task(task_kicad_create_component_data_set, lambda ds: ds + [kicad_footprint]) +dsm.register_ds("csv", kicad_footprint, "kicad-footprint-mapping", path="ee/kicad-footprint.csv") -ee.kicad.doit.init( - data_set_manager=dsm, - sch=sch, - kicad_pcb=kicad_pcb, - gerber_dir="gerber", -) +configure_kicad() +configure_bom() +configure_digikey() -ee.bom.doit.init( - data_set_manager=dsm, -) -ee.digikey.doit.doit_config.configure(data_set_manager=dsm) +def task_orders(): + import ee.bom.doit + import ee.digikey.doit + bom_cfg = ee.bom.doit.doit_config + digikey_cfg = ee.digikey.doit.doit_config -def task_orders(): - data_sets = [ee.bom.doit.doit_config.out_data_set_for(task_bom), - ee.digikey.doit.doit_config.out_data_set_for(task_digikey_resolve_schematic_components)] + data_sets = [bom_cfg.out_data_set_for(task_bom), + digikey_cfg.out_data_set_for(task_digikey_resolve_schematic_components)] yield create_task_order_csv( output_file="ee/order.csv", |