Disconnect after upload is done
parent
762d74d232
commit
34204899e6
|
@ -14,7 +14,13 @@ def blupload(printer,filename,path):
|
|||
sys.stdout.write("\b\b\b\b%02.1f%%" % (100*float(printer.queueindex)/len(printer.mainqueue),) )
|
||||
sys.stdout.flush()
|
||||
printer.send_now("M29 "+dosify(filename))
|
||||
print "Done uploading, disconnecting with a 5 second timeout in case the printer has something important to say."
|
||||
printer.disconnect()
|
||||
time.sleep(5)
|
||||
print "Upload complete. Goodbye!"
|
||||
|
||||
except:
|
||||
print "Abort, disconnecting with a 5 second timeout in case the printer has something important to say."
|
||||
printer.disconnect()
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -29,6 +35,7 @@ if __name__ == '__main__':
|
|||
p.loud=True
|
||||
time.sleep(2)
|
||||
blupload(p,tfilename,filename)
|
||||
|
||||
else:
|
||||
print "Usage: python blupload.py filename.gcode"
|
||||
|
||||
|
|
Loading…
Reference in New Issue