diff --git a/inkscape/svg2shenzhen/export.py b/inkscape/svg2shenzhen/export.py index 9fa1fd1..8441f03 100644 --- a/inkscape/svg2shenzhen/export.py +++ b/inkscape/svg2shenzhen/export.py @@ -14,8 +14,12 @@ from copy import deepcopy from inkex import bezier from inkex.transforms import Transform +from pathlib import Path +homePath = str() +homePath = Path.home() + EXPORT_PNG_MAX_PROCESSES = 3 EXPORT_KICAD_MAX_PROCESSES = 2 @@ -254,7 +258,7 @@ def __init__(self): } def add_arguments(self, pars): - pars.add_argument("--path", default="~/") + pars.add_argument("--path", default=homePath) pars.add_argument('-f', '--filetype', default='jpeg', help='Exported file type') pars.add_argument("--crop", type=inkex.Boolean, default=False) pars.add_argument("--dpi", type=int, default=600) @@ -338,7 +342,12 @@ def processAutoMaskFromTo(self, from_layer, to_layer): def processExportLayer(self): options = self.options - output_path = os.path.expanduser(options.path) + if os.path.dirname(os.getcwd()) == options.path: + inkex.errormsg('EXPORT ERROR! Please Select A Directory To Export To!') + exit() + else: + output_path = os.path.expanduser(options.path) + curfile = self.options.input_file layers = self.get_layers(curfile) name = self.get_name() diff --git a/inkscape/svg2shenzhen_about.inx b/inkscape/svg2shenzhen_about.inx index aea2f7e..982b9c3 100644 --- a/inkscape/svg2shenzhen_about.inx +++ b/inkscape/svg2shenzhen_about.inx @@ -1,25 +1,23 @@ - - <_name>0. Help + <_name>About net.svg2shenzhen.about.me - - - <_param name="help" type="description"> -Svg2Shenzhen version SVGSZ_VER -Inkscape extension to export drawing as a KiCad Module or KiCad Project - -Get New Update: -https://github.com/badgeek/svg2shenzhen - -Support this software: -https://patreon.com/badgeek - - - - - + + + +<_param name="help" type="description" xml:space="preserve">Inkscape Extension to Export Drawings as a KiCad Module or KiCad Project + +To get updates, get help, review the source, or contribute please visit the project's GitHub page. + +Thank you to everyone who has contributed to Svg2Shenzhen. + + + + + + + @@ -27,5 +25,4 @@ https://patreon.com/badgeek all - diff --git a/inkscape/svg2shenzhen_export.inx b/inkscape/svg2shenzhen_export.inx index cb6cbbc..316b6dc 100644 --- a/inkscape/svg2shenzhen_export.inx +++ b/inkscape/svg2shenzhen_export.inx @@ -1,22 +1,24 @@ - <_name>2. Export Kicad + <_name>2. Export to KiCad net.svg2shenzhen.export.layers svg2shenzhen/export.py - Export Drawing to KiCad PCB Format - - - - + + + + + - 5 - 1200 - true - false - true - false - + 5 + 1200 + + false + false + false + false + + all