Commit a300fb8e authored by Andrew Dalgleish's avatar Andrew Dalgleish

Add online check to printcore send() similar to send_now()

parent 510b7db6
...@@ -198,6 +198,7 @@ class printcore(): ...@@ -198,6 +198,7 @@ class printcore():
"""Adds a command to the checksummed main command queue if printing, or sends the command immediately if not printing """Adds a command to the checksummed main command queue if printing, or sends the command immediately if not printing
""" """
if(self.online):
if(self.printing): if(self.printing):
self.mainqueue+=[command] self.mainqueue+=[command]
else: else:
...@@ -212,6 +213,8 @@ class printcore(): ...@@ -212,6 +213,8 @@ class printcore():
while ((wait > 0) and not self.clear): while ((wait > 0) and not self.clear):
time.sleep(0.001) time.sleep(0.001)
wait-=1 wait-=1
else:
print "Not connected to printer."
def send_now(self,command,wait=0): def send_now(self,command,wait=0):
......
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