Commit 93d258f6 authored by Guillaume Seguin's avatar Guillaume Seguin

Whiespace cleanup + correctly decrease wait time in send and send_now

parent 61ba81bc
...@@ -242,12 +242,12 @@ class printcore(): ...@@ -242,12 +242,12 @@ class printcore():
if line.startswith(tuple(self.greetings)) or line.startswith('ok'): if line.startswith(tuple(self.greetings)) or line.startswith('ok'):
self.clear = True self.clear = True
if line.startswith('ok') and "T:" in line and self.tempcb: if line.startswith('ok') and "T:" in line and self.tempcb:
#callback for temp, status, whatever #callback for temp, status, whatever
try: self.tempcb(line) try: self.tempcb(line)
except: pass except: pass
elif line.startswith('Error'): elif line.startswith('Error'):
if self.errorcb: if self.errorcb:
#callback for errors #callback for errors
try: self.errorcb(line) try: self.errorcb(line)
except: pass except: pass
# Teststrings for resend parsing # Firmware exp. result # Teststrings for resend parsing # Firmware exp. result
...@@ -373,7 +373,7 @@ class printcore(): ...@@ -373,7 +373,7 @@ class printcore():
self.lineno += 1 self.lineno += 1
while wait > 0 and self.printer and self.printing and not self.clear: while wait > 0 and self.printer and self.printing and not self.clear:
time.sleep(0.001) time.sleep(0.001)
wait -= 1 wait -= 0.001
else: else:
print "Not connected to printer." print "Not connected to printer."
...@@ -393,7 +393,7 @@ class printcore(): ...@@ -393,7 +393,7 @@ class printcore():
self._send(command) self._send(command)
while (wait > 0) and self.printer and self.printing and not self.clear: while (wait > 0) and self.printer and self.printing and not self.clear:
time.sleep(0.001) time.sleep(0.001)
wait -= 1 wait -= 0.001
else: else:
print "Not connected to printer." print "Not connected to printer."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment