- fixed an issue with path conversion when using Windows-style of paths in the 'set_path' Tcl command

This commit is contained in:
Marius Stanciu
2022-01-17 23:37:28 +02:00
committed by Marius
parent 2430158334
commit c08acc79eb
3 changed files with 6 additions and 6 deletions

View File

@@ -15,6 +15,7 @@ CHANGELOG for FlatCAM beta
- fixing an issue with not building the UI for the generated objects when running a script and then trying to enable/disable the plots
- attempting to add a feature in the text editors to autoselect all words in a document that are the same as the one that was clicked
- all the colors set in Preferences now have to be in the 8digits format RGBA (including the alpha channel as a suffix) - it is required to delete the current preferences files
- fixed an issue with path conversion when using Windows-style of paths in the 'set_path' Tcl command
15.01.2022

View File

@@ -250,7 +250,8 @@ class ScriptObject(FlatCAMObj):
# if FlatCAM is run in Windows then replace all the slashes with
# the UNIX style slash that TCL understands
if sys.platform == 'win32':
if "open" in tcl_command_line:
tcl_command_line_lowered = tcl_command_line.lower()
if "open" in tcl_command_line_lowered or "path" in tcl_command_line_lowered:
tcl_command_line = tcl_command_line.replace('\\', '/')
if old_line != '':

View File

@@ -166,9 +166,6 @@ class TclCommand(object):
Pre-processes arguments to detect '-keyword value' pairs into dictionary
and standalone parameters into list.
This is copy from FlatCAMApp.setup_shell().h() just for accessibility,
original should be removed after all commands will be converted
:param args: arguments from tcl to parse
:return: arguments, options
"""
@@ -189,10 +186,11 @@ class TclCommand(object):
option_name = match.group(1)
continue
init_arg = args[i]
if option_name is None:
arguments.append(args[i])
arguments.append(init_arg)
else:
options[option_name] = args[i]
options[option_name] = init_arg
option_name = None
if option_name is not None: