diff --git a/cura/PrinterOutput/FirmwareUpdater.py b/cura/PrinterOutput/FirmwareUpdater.py index d33015920a..3f20e0f3c4 100644 --- a/cura/PrinterOutput/FirmwareUpdater.py +++ b/cura/PrinterOutput/FirmwareUpdater.py @@ -75,4 +75,4 @@ class FirmwareUpdateState(IntEnum): communication_error = 4 io_error = 5 firmware_not_found_error = 6 - invalid_firmware_error = 7 + diff --git a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml index 90a27c24e1..b5b6c15f50 100644 --- a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml +++ b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml @@ -151,8 +151,6 @@ Cura.MachineAction return catalog.i18nc("@label","Firmware update failed due to an input/output error."); case 6: return catalog.i18nc("@label","Firmware update failed due to missing firmware."); - case 7: - return catalog.i18nc("@label","Firmware update failed due to invalid firmware file."); } } diff --git a/plugins/USBPrinting/AvrFirmwareUpdater.py b/plugins/USBPrinting/AvrFirmwareUpdater.py index ded2036efe..0f7146560d 100644 --- a/plugins/USBPrinting/AvrFirmwareUpdater.py +++ b/plugins/USBPrinting/AvrFirmwareUpdater.py @@ -27,9 +27,6 @@ class AvrFirmwareUpdater(FirmwareUpdater): except (FileNotFoundError, AssertionError): Logger.log("e", "Unable to read provided hex file. Could not update firmware.") self._setFirmwareUpdateState(FirmwareUpdateState.firmware_not_found_error) - except Exception: - Logger.logException("e", "Failed to read hex file '%s'", self._firmware_file) - self._setFirmwareUpdateState(FirmwareUpdateState.invalid_firmware_error) return programmer = stk500v2.Stk500v2() diff --git a/plugins/USBPrinting/avr_isp/intelHex.py b/plugins/USBPrinting/avr_isp/intelHex.py index 3c5c66d805..671f1788f7 100644 --- a/plugins/USBPrinting/avr_isp/intelHex.py +++ b/plugins/USBPrinting/avr_isp/intelHex.py @@ -5,16 +5,13 @@ See: http://en.wikipedia.org/wiki/Intel_HEX This is a python 3 conversion of the code created by David Braam for the Cura project. """ import io -from typing import List - from UM.Logger import Logger - -def readHex(filename: str) -> List[int]: +def readHex(filename): """ Read an verify an intel hex file. Return the data as an list of bytes. """ - data = [] # type: List[int] + data = [] extra_addr = 0 f = io.open(filename, "r", encoding = "utf-8") for line in f: