From 31da9098a00894920cbe4502c232a785feaf1b59 Mon Sep 17 00:00:00 2001 From: kliment Date: Tue, 7 Jun 2011 07:46:29 +0200 Subject: [PATCH] Fix pause command. Fix help for pause command. --- printcore.py | 1 + pronsole.py | 22 ++-------------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/printcore.py b/printcore.py index b36d460..a85798a 100644 --- a/printcore.py +++ b/printcore.py @@ -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-1): self._send(self.sentlines[self.resendfrom],self.resendfrom,False) diff --git a/pronsole.py b/pronsole.py index af6412d..437af2e 100644 --- a/pronsole.py +++ b/pronsole.py @@ -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."