Initial implementation of console.

This commit is contained in:
Juan Pablo Caram
2014-09-13 17:29:07 -04:00
parent 32076d4020
commit 8cb509d6f3
7 changed files with 526 additions and 14 deletions

27
FlatCAMShell.py Normal file
View File

@@ -0,0 +1,27 @@
import sys
from PyQt4.QtGui import QApplication
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.execCommand(text)