Fix pause command. Fix help for pause command.

master
kliment 2011-06-07 07:46:29 +02:00
parent fd6eb8ac3a
commit 31da9098a0
2 changed files with 3 additions and 20 deletions

View File

@ -185,6 +185,7 @@ class printcore():
time.sleep(0.001)
self.clear=False
if not (self.printing and self.printer and self.online):
self.clear=True
return
if(self.resendfrom<self.lineno and self.resendfrom>-1):
self._send(self.sentlines[self.resendfrom],self.resendfrom,False)

View File

@ -305,12 +305,12 @@ class pronsole(cmd.Cmd):
print "Not printing, cannot pause."
return
self.p.pause()
self.p.connect()# This seems to work, but is not a good solution.
#self.p.connect()# This seems to work, but is not a good solution.
self.paused=True
#self.do_resume(None)
def help_pause(self,l):
def help_pause(self):
print "Pauses a running print"
def do_resume(self,l):
@ -323,24 +323,6 @@ class pronsole(cmd.Cmd):
return
else:
self.p.resume()
return
try:
self.p.resume()
#print self.p.printing
sys.stdout.write("Progress: 00.0%")
sys.stdout.flush()
time.sleep(1)
while self.p.printing:
time.sleep(1)
sys.stdout.write("\b\b\b\b\b%04.1f%%" % (100*float(self.p.queueindex)/len(self.p.mainqueue),) )
sys.stdout.flush()
print "\b\b\b\b\b100%. Print completed."
return
except:
print "...interrupted!"
self.paused=True
self.p.pause()
print "Use the resume command to resume this print"
def help_resume(self):
print "Resumes a paused print."