Commit 90e5d226 authored by kliment's avatar kliment

Merge pull request #242 from logxen/experimental

make send_now check that the printer is online before talking to it
parents b5dbecc8 97cad4e0
......@@ -209,13 +209,16 @@ class printcore():
def send_now(self,command):
"""Sends a command to the printer ahead of the command queue, without a checksum
"""
if(self.printing):
self.priqueue+=[command]
else:
while not self.clear:
time.sleep(0.001)
self._send(command)
#callback for command sent
if(self.online):
if(self.printing):
self.priqueue+=[command]
else:
while not self.clear:
time.sleep(0.001)
self._send(command)
#callback for command sent
else
print "Not connected to printer."
def _print(self):
#callback for printing started
......
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