-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlatCAMShell.py
More file actions
33 lines (28 loc) · 1.12 KB
/
FlatCAMShell.py
File metadata and controls
33 lines (28 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
############################################################
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
import termwidget
class FCShell(termwidget.TermWidget):
def __init__(self, sysShell, *args):
termwidget.TermWidget.__init__(self, *args)
self._sysShell = sysShell
def is_command_complete(self, text):
def skipQuotes(text):
quote = text[0]
text = text[1:]
endIndex = str(text).index(quote)
return text[endIndex:]
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):
self._sysShell.exec_command(text)