- disabled a skip_quotes method in ToolShell.FCShell class so I can now use quotes to enclose file paths with spaces inside
This commit is contained in:
parent
35674c9647
commit
907e4bc6d9
|
@ -28,7 +28,7 @@ CHANGELOG for FlatCAM beta
|
|||
- in SVG parser modified some imports to be one on each line
|
||||
- fixed the Tcl Command BBox (leftovers from recent global changes)
|
||||
- fixed some typos in strings reported by @pcb-hobbyst on FlatCAM forum
|
||||
|
||||
- disabled a skip_quotes method in ToolShell.FCShell class so I can now use quotes to enclose file paths with spaces inside
|
||||
|
||||
27.04.2020
|
||||
|
||||
|
|
|
@ -2694,8 +2694,7 @@ class _ExpandableTextEdit(QTextEdit):
|
|||
if line_count <= 1:
|
||||
self.historyPrev.emit()
|
||||
return
|
||||
elif event.matches(QKeySequence.MoveToNextPage) or \
|
||||
event.matches(QKeySequence.MoveToPreviousPage):
|
||||
elif event.matches(QKeySequence.MoveToNextPage) or event.matches(QKeySequence.MoveToPreviousPage):
|
||||
return self._termWidget.browser().keyPressEvent(event)
|
||||
|
||||
tc = self.textCursor()
|
||||
|
|
|
@ -107,25 +107,25 @@ class TermWidget(QWidget):
|
|||
mtype = text[:idx+1].upper()
|
||||
mtype = mtype.replace('_NOTCL', '')
|
||||
body = text[idx+1:]
|
||||
if style == 'in':
|
||||
if style.lower() == 'in':
|
||||
text = '<span style="font-weight: bold;">%s</span>' % text
|
||||
elif style == 'err':
|
||||
elif style.lower() == 'err':
|
||||
text = '<span style="font-weight: bold; color: red;">%s</span>'\
|
||||
'<span style="font-weight: bold;">%s</span>'\
|
||||
% (mtype, body)
|
||||
elif style == 'warning':
|
||||
elif style.lower() == 'warning':
|
||||
# text = '<span style="font-weight: bold; color: #f4b642;">%s</span>' % text
|
||||
text = '<span style="font-weight: bold; color: #f4b642;">%s</span>' \
|
||||
'<span style="font-weight: bold;">%s</span>' \
|
||||
% (mtype, body)
|
||||
elif style == 'success':
|
||||
elif style.lower() == 'success':
|
||||
# text = '<span style="font-weight: bold; color: #15b300;">%s</span>' % text
|
||||
text = '<span style="font-weight: bold; color: #15b300;">%s</span>' \
|
||||
'<span style="font-weight: bold;">%s</span>' \
|
||||
% (mtype, body)
|
||||
elif style == 'selected':
|
||||
elif style.lower() == 'selected':
|
||||
text = ''
|
||||
elif style == 'raw':
|
||||
elif style.lower() == 'raw':
|
||||
text = text
|
||||
else:
|
||||
# without span <br/> is ignored!!!
|
||||
|
@ -226,7 +226,7 @@ class TermWidget(QWidget):
|
|||
|
||||
def is_command_complete(self, text):
|
||||
"""
|
||||
Executed by _ExpandableTextEdit. Reimplement this function in the child classes.
|
||||
Executed by _ExpandableTextEdit. Re-implement this function in the child classes.
|
||||
"""
|
||||
return True
|
||||
|
||||
|
@ -344,19 +344,23 @@ class FCShell(TermWidget):
|
|||
''')
|
||||
|
||||
def is_command_complete(self, text):
|
||||
|
||||
def skipQuotes(txt):
|
||||
quote = txt[0]
|
||||
text_val = txt[1:]
|
||||
endIndex = str(text_val).index(quote)
|
||||
return text[endIndex:]
|
||||
|
||||
while text:
|
||||
if text[0] in ('"', "'"):
|
||||
try:
|
||||
text = skipQuotes(text)
|
||||
except ValueError:
|
||||
return False
|
||||
text = text[1:]
|
||||
# I'm disabling this because I need to be able to load paths that have spaces by
|
||||
# enclosing them in quotes --- Marius Stanciu
|
||||
# while text:
|
||||
# if text[0] in ('"', "'"):
|
||||
# try:
|
||||
# text = skipQuotes(text)
|
||||
# except ValueError:
|
||||
# return False
|
||||
# text = text[1:]
|
||||
|
||||
return True
|
||||
|
||||
def child_exec_command(self, text):
|
||||
|
|
|
@ -53,9 +53,9 @@ class TclCommandOpenExcellon(TclCommandSignaled):
|
|||
|
||||
filename = args.pop('filename')
|
||||
|
||||
if ' ' in filename:
|
||||
return "The absolute path to the project file contain spaces which is not allowed.\n" \
|
||||
"Please enclose the path within quotes."
|
||||
# if ' ' in filename:
|
||||
# return "The absolute path to the project file contain spaces which is not allowed.\n" \
|
||||
# "Please enclose the path within quotes."
|
||||
|
||||
args['plot'] = False
|
||||
args['from_tcl'] = True
|
||||
|
|
|
@ -53,8 +53,8 @@ class TclCommandOpenGCode(TclCommandSignaled):
|
|||
args['plot'] = False
|
||||
args['from_tcl'] = True
|
||||
filename = args["filename"]
|
||||
if ' ' in filename:
|
||||
return "The absolute path to the project file contain spaces which is not allowed.\n" \
|
||||
"Please enclose the path within quotes."
|
||||
# if ' ' in filename:
|
||||
# return "The absolute path to the project file contain spaces which is not allowed.\n" \
|
||||
# "Please enclose the path within quotes."
|
||||
|
||||
self.app.open_gcode(filename, **args)
|
||||
|
|
|
@ -55,10 +55,6 @@ class TclCommandOpenGerber(TclCommandSignaled):
|
|||
|
||||
filename = args.pop('filename')
|
||||
|
||||
if ' ' in filename:
|
||||
return "The absolute path to the project file contain spaces which is not allowed.\n" \
|
||||
"Please enclose the path within quotes."
|
||||
|
||||
if 'outname' in args:
|
||||
outname = args['outname']
|
||||
else:
|
||||
|
|
|
@ -49,8 +49,8 @@ class TclCommandOpenProject(TclCommandSignaled):
|
|||
:return: None or exception
|
||||
"""
|
||||
filename = args['filename']
|
||||
if ' ' in filename:
|
||||
return "The absolute path to the project file contain spaces which is not allowed.\n" \
|
||||
"Please enclose the path within quotes."
|
||||
# if ' ' in filename:
|
||||
# return "The absolute path to the project file contain spaces which is not allowed.\n" \
|
||||
# "Please enclose the path within quotes."
|
||||
|
||||
self.app.open_project(filename, cli=True, plot=False, from_tcl=True)
|
||||
|
|
Loading…
Reference in New Issue