- multiple fixes in the Tcl commands (especially regarding the interchange between True/false and 1/0 values)

- updated the help for all Tcl Commands
- in Tcl Shell, the 'help' command will add also a brief description for each command in the list
This commit is contained in:
Marius Stanciu
2020-04-13 19:15:20 +03:00
committed by Marius
parent 5dcddb168e
commit 8a299e8fc8
66 changed files with 350 additions and 172 deletions

View File

@@ -21,6 +21,8 @@ class TclCommandBbox(TclCommand):
# array of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon)
aliases = ['bounding_box', 'bbox']
description = '%s %s' % ("--", "Creates a rectangular Geometry object that surrounds the object.")
# dictionary of types from Tcl command, needs to be ordered
arg_names = collections.OrderedDict([
('name', str)
@@ -30,7 +32,7 @@ class TclCommandBbox(TclCommand):
option_types = collections.OrderedDict([
('outname', str),
('margin', float),
('rounded', bool)
('rounded', str)
])
# array of mandatory options for current Tcl command: required = {'name','outname'}
@@ -41,11 +43,11 @@ class TclCommandBbox(TclCommand):
'main': "Creates a rectangular Geometry object that surrounds the object.",
'args': collections.OrderedDict([
('name', 'Object name for which to create bounding box. String'),
('outname', 'Name of the resulting Geometry object. String.'),
('margin', "Distance of the edges of the box to the nearest polygon."
"Float number."),
('rounded', "If the bounding box is to have rounded corners their radius is equal to the margin. "
"True or False.")
"True (1) or False (0)."),
('outname', 'Name of the resulting Geometry object. String.')
]),
'examples': ['bbox name -outname name_bbox']
}
@@ -78,8 +80,8 @@ class TclCommandBbox(TclCommand):
margin = args['margin']
if 'rounded' not in args:
args['rounded'] = self.app.defaults["gerber_bboxrounded"]
rounded = bool(args['rounded'])
args['rounded'] = bool(eval(self.app.defaults["gerber_bboxrounded"]))
rounded = bool(eval(args['rounded']))
del args['name']