- made sure that in Tcl commands deleting argument keys will not raise an error
This commit is contained in:
@@ -10,6 +10,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
17.01.2022
|
17.01.2022
|
||||||
|
|
||||||
- fixed issues in the 'millslots' and 'milldrills' Tcl commands for the case when some parameters are not used
|
- fixed issues in the 'millslots' and 'milldrills' Tcl commands for the case when some parameters are not used
|
||||||
|
- made sure that in Tcl commands deleting argument keys will not raise an error
|
||||||
|
|
||||||
15.01.2022
|
15.01.2022
|
||||||
|
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ class TclCommandSignaled(TclCommand):
|
|||||||
args, unnamed_args = self.check_args(args)
|
args, unnamed_args = self.check_args(args)
|
||||||
if 'timeout' in args:
|
if 'timeout' in args:
|
||||||
passed_timeout = args['timeout']
|
passed_timeout = args['timeout']
|
||||||
del args['timeout']
|
args.pop('timeout', None)
|
||||||
else:
|
else:
|
||||||
passed_timeout = self.app.defaults['global_background_timeout']
|
passed_timeout = self.app.defaults['global_background_timeout']
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class TclCommandBbox(TclCommand):
|
|||||||
else:
|
else:
|
||||||
rounded = bool(eval(self.app.defaults["gerber_bboxrounded"]))
|
rounded = bool(eval(self.app.defaults["gerber_bboxrounded"]))
|
||||||
|
|
||||||
del args['name']
|
args.pop('name', None)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
def geo_init(geo_obj, app_obj):
|
def geo_init(geo_obj, app_obj):
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ class TclCommandCncjob(TclCommandSignaled):
|
|||||||
self.raise_tcl_error("The entered value for 'toolchangexy' needs to have the format x,y or "
|
self.raise_tcl_error("The entered value for 'toolchangexy' needs to have the format x,y or "
|
||||||
"in format (x, y) - no spaces allowed. But always two comma separated values.")
|
"in format (x, y) - no spaces allowed. But always two comma separated values.")
|
||||||
|
|
||||||
del args['name']
|
args.pop('name', None)
|
||||||
|
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if arg == "toolchange_xy" or arg == "spindlespeed" or arg == "startz":
|
if arg == "toolchange_xy" or arg == "spindlespeed" or arg == "startz":
|
||||||
|
|||||||
@@ -78,5 +78,5 @@ class TclCommandExportGcode(TclCommandSignaled):
|
|||||||
if self.app.collection.has_promises():
|
if self.app.collection.has_promises():
|
||||||
self.raise_tcl_error('!!!Promises exists, but should not here!!!')
|
self.raise_tcl_error('!!!Promises exists, but should not here!!!')
|
||||||
|
|
||||||
del args['name']
|
args.pop('name', None)
|
||||||
return obj.get_gcode(**args)
|
return obj.get_gcode(**args)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class TclCommandFollow(TclCommandSignaled):
|
|||||||
if obj.kind != 'gerber':
|
if obj.kind != 'gerber':
|
||||||
self.raise_tcl_error('Expected GerberObject, got %s %s.' % (name, type(obj)))
|
self.raise_tcl_error('Expected GerberObject, got %s %s.' % (name, type(obj)))
|
||||||
|
|
||||||
del args['name']
|
args.pop('name', None)
|
||||||
try:
|
try:
|
||||||
obj.follow_geo(**args)
|
obj.follow_geo(**args)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -93,5 +93,5 @@ class TclCommandIsolate(TclCommandSignaled):
|
|||||||
if obj.kind != 'gerber':
|
if obj.kind != 'gerber':
|
||||||
self.raise_tcl_error('Expected GerberObject, got %s %s.' % (name, type(obj)))
|
self.raise_tcl_error('Expected GerberObject, got %s %s.' % (name, type(obj)))
|
||||||
|
|
||||||
del args['name']
|
args.pop('name', None)
|
||||||
obj.isolate(plot=False, **args)
|
obj.isolate(plot=False, **args)
|
||||||
|
|||||||
@@ -132,10 +132,8 @@ class TclCommandMillDrills(TclCommandSignaled):
|
|||||||
args['tools'] = 'all'
|
args['tools'] = 'all'
|
||||||
|
|
||||||
# no longer needed
|
# no longer needed
|
||||||
if 'milled_dias' in args:
|
args.pop('milled_dias', None)
|
||||||
del args['milled_dias']
|
args.pop('diatol', None)
|
||||||
if 'diatol' in args:
|
|
||||||
del args['diatol']
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.raise_tcl_error("Bad tools: %s" % str(e))
|
self.raise_tcl_error("Bad tools: %s" % str(e))
|
||||||
|
|
||||||
@@ -147,7 +145,7 @@ class TclCommandMillDrills(TclCommandSignaled):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# 'name' is not an argument of obj.generate_milling()
|
# 'name' is not an argument of obj.generate_milling()
|
||||||
del args['name']
|
args.pop('name', None)
|
||||||
|
|
||||||
# This runs in the background... Is blocking handled?
|
# This runs in the background... Is blocking handled?
|
||||||
success, msg = obj.generate_milling_drills(plot=False, **args)
|
success, msg = obj.generate_milling_drills(plot=False, **args)
|
||||||
|
|||||||
@@ -126,22 +126,14 @@ class TclCommandMillSlots(TclCommandSignaled):
|
|||||||
"TclCommand are not actual tool diameters in the Excellon object.")
|
"TclCommand are not actual tool diameters in the Excellon object.")
|
||||||
|
|
||||||
args['tools'] = req_tools
|
args['tools'] = req_tools
|
||||||
|
|
||||||
# no longer needed
|
|
||||||
del args['milled_dias']
|
|
||||||
del args['diatol']
|
|
||||||
|
|
||||||
# Split and put back. We are passing the whole dictionary later.
|
# Split and put back. We are passing the whole dictionary later.
|
||||||
# args['milled_dias'] = [x.strip() for x in args['tools'].split(",")]
|
# args['milled_dias'] = [x.strip() for x in args['tools'].split(",")]
|
||||||
else:
|
else:
|
||||||
args['tools'] = 'all'
|
args['tools'] = 'all'
|
||||||
|
|
||||||
# no longer needed
|
# no longer needed
|
||||||
if 'milled_dias' in args:
|
args.pop('milled_dias', None)
|
||||||
del args['milled_dias']
|
args.pop('diatol', None)
|
||||||
if 'diatol' in args:
|
|
||||||
del args['diatol']
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.raise_tcl_error("Bad tools: %s" % str(e))
|
self.raise_tcl_error("Bad tools: %s" % str(e))
|
||||||
|
|
||||||
@@ -153,7 +145,7 @@ class TclCommandMillSlots(TclCommandSignaled):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# 'name' is not an argument of obj.generate_milling()
|
# 'name' is not an argument of obj.generate_milling()
|
||||||
del args['name']
|
args.pop('name', None)
|
||||||
|
|
||||||
# This runs in the background... Is blocking handled?
|
# This runs in the background... Is blocking handled?
|
||||||
success, msg = obj.generate_milling_slots(plot=False, **args)
|
success, msg = obj.generate_milling_slots(plot=False, **args)
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class TclCommandNregions(TclCommand):
|
|||||||
else:
|
else:
|
||||||
rounded = bool(eval(self.app.defaults["gerber_noncopperrounded"]))
|
rounded = bool(eval(self.app.defaults["gerber_noncopperrounded"]))
|
||||||
|
|
||||||
del args['name']
|
args.pop('name', None)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
def geo_init(geo_obj, app_obj):
|
def geo_init(geo_obj, app_obj):
|
||||||
|
|||||||
Reference in New Issue
Block a user