Patching do_load so that it updates the pronterface ui when the load command is used within pronterface

Conflicts:

	pronterface.py
master
D1plo1d 2012-08-19 22:10:46 -04:00
parent b8f63cd17e
commit ef6ffecfd4
2 changed files with 12 additions and 1 deletions

View File

@ -621,6 +621,9 @@ class pronsole(cmd.Cmd):
print "Disconnects from the printer"
def do_load(self,l):
self._do_load(l)
def _do_load(self,l):
if len(l)==0:
print "No file name given."
return
@ -631,7 +634,7 @@ class pronsole(cmd.Cmd):
self.f=[i.replace("\n","").replace("\r","") for i in open(l)]
self.filename=l
print "Loaded ",l,", ",len(self.f)," lines."
def complete_load(self, text, line, begidx, endidx):
s=line.split()
if len(s)>2:

View File

@ -173,6 +173,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.webInterface=webinterface.WebInterface(self)
self.webThread = Thread(target=webinterface.StartWebInterfaceThread, args=(self.webInterface, ))
self.webThread.start()
if(self.filename is not None):
self.do_load(self.filename)
def startcb(self):
self.starttime=time.time()
@ -1554,6 +1556,12 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
thread(target=self.skein_func).start()
thread(target=self.skein_monitor).start()
def do_load(self,l):
if hasattr(self, 'skeining'):
self.loadfile(None, l)
else:
self._do_load(l)
def loadfile(self,event,filename=None):
if self.skeining and self.skeinp is not None:
self.skeinp.terminate()