mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 02:06:01 +08:00
Setting progress won't cause devision by zero anymore
CURA-49
This commit is contained in:
parent
bb1a616c1f
commit
4090e461df
@ -173,7 +173,10 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||
self._progress_message.hide()
|
||||
|
||||
def _onUploadProgress(self, bytes_sent, bytes_total):
|
||||
self._progress_message.setProgress(bytes_sent / bytes_total * 100)
|
||||
if bytes_total > 0:
|
||||
self._progress_message.setProgress(bytes_sent / bytes_total * 100)
|
||||
else:
|
||||
self._progress_message.setProgress(0)
|
||||
|
||||
def _httpGet(self, path):
|
||||
return requests.get("http://" + self._address + self._api_prefix + path)
|
Loading…
x
Reference in New Issue
Block a user