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.write("\b\b\b\b%02.1f%%" % (100*float(printer.queueindex)/len(printer.mainqueue),) )
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
printer.send_now("M29 "+dosify(filename))
|
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:
|
except:
|
||||||
|
print "Abort, disconnecting with a 5 second timeout in case the printer has something important to say."
|
||||||
printer.disconnect()
|
printer.disconnect()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -29,6 +35,7 @@ if __name__ == '__main__':
|
||||||
p.loud=True
|
p.loud=True
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
blupload(p,tfilename,filename)
|
blupload(p,tfilename,filename)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print "Usage: python blupload.py filename.gcode"
|
print "Usage: python blupload.py filename.gcode"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue