aboutsummaryrefslogtreecommitdiff
path: root/trygvis/eda/cli/eda_rdf.py
diff options
context:
space:
mode:
Diffstat (limited to 'trygvis/eda/cli/eda_rdf.py')
-rw-r--r--trygvis/eda/cli/eda_rdf.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/trygvis/eda/cli/eda_rdf.py b/trygvis/eda/cli/eda_rdf.py
index 33018ec..ecd4ba6 100644
--- a/trygvis/eda/cli/eda_rdf.py
+++ b/trygvis/eda/cli/eda_rdf.py
@@ -45,19 +45,7 @@ class KicadBomToTtl(CliCommand):
args = p.parse_args(argv)
from trygvis.eda.cli import kicad_bom_to_ttl
-
- if args.input is not None:
- src = open(args.input, "r")
- else:
- src = sys.stdin
-
- if args.output is not None:
- dst = open(args.output, "wb")
- else:
- dst = sys.stdout.buffer
-
- with src, dst:
- kicad_bom_to_ttl.run(src, dst, args)
+ kicad_bom_to_ttl.run(args)
class DigikeyDownloadForSchematic(CliCommand):
@@ -73,6 +61,19 @@ class DigikeyDownloadForSchematic(CliCommand):
digikey_download_for_schematic.run(args.schematic, args)
+class DigikeyDownloadMetadata(CliCommand):
+ def __init__(self):
+ super().__init__("digikey-download-metadata", "Download category tree and attribute types and values from digikey.com")
+
+ def run(self, argv):
+ p = argparse.ArgumentParser(prog=self.key, description=self.description)
+ p.add_argument("--output-dir", dest="output_dir", required=True)
+ args = p.parse_args(argv)
+
+ from trygvis.eda.cli import digikey_download_metadata
+ digikey_download_metadata.run(args)
+
+
class DigikeyDownloadAttributeTypesForCategory(CliCommand):
def __init__(self):
super().__init__("digikey-download-attribute-types-for-category", "Download the attribute types for a category from digikey.com")
@@ -124,6 +125,7 @@ def main():
KicadBomToTtl(),
DigikeyDownloadForSchematic(),
DigikeyDownloadAttributeTypesForCategory(),
+ DigikeyDownloadMetadata()
]
parser = argparse.ArgumentParser(