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

master
Andrew Dalgleish 2012-06-29 01:23:52 +10:00
parent 510b7db655
commit a300fb8eb2
1 changed files with 16 additions and 13 deletions

View File

@ -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
"""
if(self.online):
if(self.printing):
self.mainqueue+=[command]
else:
@ -212,6 +213,8 @@ class printcore():
while ((wait > 0) and not self.clear):
time.sleep(0.001)
wait-=1
else:
print "Not connected to printer."
def send_now(self,command,wait=0):