Commit 34204899 authored by kliment's avatar kliment

Disconnect after upload is done

parent 762d74d2
...@@ -14,7 +14,13 @@ def blupload(printer,filename,path): ...@@ -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__': ...@@ -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"
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