diff options
Diffstat (limited to 'gerbonara/cli.py')
-rw-r--r-- | gerbonara/cli.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gerbonara/cli.py b/gerbonara/cli.py index 95be4db..d6b93f2 100644 --- a/gerbonara/cli.py +++ b/gerbonara/cli.py @@ -31,6 +31,8 @@ from .cam import FileSettings from .rs274x import GerberFile from . import layers as lyr from . import __version__ +from .cad.kicad import schematic as kc_schematic +from .cad.kicad import tmtheme def _print_version(ctx, param, value): @@ -129,6 +131,27 @@ def cli(): pass +@cli.group('kicad') +def kicad_group(): + pass + + +@kicad_group.group('schematic') +def schematic_group(): + pass + + +@schematic_group.command() +@click.argument('inpath', type=click.Path(exists=True)) +@click.argument('theme', type=click.Path(exists=True)) +@click.argument('outfile', type=click.File('w'), default='-') +def render(inpath, theme, outfile): + sch = kc_schematic.Schematic.open(inpath) + cs = tmtheme.TmThemeSchematic(Path(theme).read_text()) + with outfile as f: + f.write(str(sch.to_svg(cs))) + + @cli.command() @click.option('--warnings', 'format_warnings', type=click.Choice(['default', 'ignore', 'once']), default='default', help='''Enable or disable file format warnings during parsing (default: on)''') |