@@ -214,6 +214,8 @@ def __init__(self):
214214 self .OptionParser .add_option ("--openfactory" , action = "store" , type = "inkbool" , dest = "openfactory" , default = "true" )
215215 self .OptionParser .add_option ("--openkicad" , action = "store" , type = "inkbool" , dest = "openkicad" , default = "true" )
216216 self .OptionParser .add_option ("--autoflatten" , action = "store" , type = "inkbool" , dest = "autoflatten" , default = "true" )
217+ self .OptionParser .add_option ("--debug" , action = "store" , type = "inkbool" , dest = "debug" , default = False )
218+
217219
218220
219221 self .doc_width = 0
@@ -516,14 +518,16 @@ def exportToKicad(self, png_path, output_path, layer_type, invert = "true"):
516518 bitmap2component_exe = os .path .join (plugin_path , 'bitmap2component.exe' )
517519
518520 command = "\" %s\" \" %s\" \" %s\" %s %s %s %s" % (bitmap2component_exe , png_path , output_path , layer_type , invert , str (int (self .options .dpi )) , str (int (self .options .threshold )))
519- inkex .debug (command )
521+ if (self .options .debug ):
522+ inkex .debug (command )
520523 return subprocess .Popen (command .encode ("utf-8" ), shell = True , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
521524
522525
523526 def exportToPng (self , svg_path , output_path ):
524527 area_param = '-D' if self .options .crop else 'C'
525528 command = "inkscape %s -d %s -e \" %s\" \" %s\" " % (area_param , self .options .dpi , output_path , svg_path )
526- inkex .debug (command )
529+ if (self .options .debug ):
530+ inkex .debug (command )
527531 return subprocess .Popen (command .encode ("utf-8" ), shell = True , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
528532
529533
0 commit comments