From 09742f0cf51769b46ac8be2402d1db9df10a5061 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Fri, 28 Sep 2018 13:09:59 +0200 Subject: [PATCH] Simplify code --- cura/Settings/GlobalStack.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cura/Settings/GlobalStack.py b/cura/Settings/GlobalStack.py index e3ae8c2deb..da1ec61254 100755 --- a/cura/Settings/GlobalStack.py +++ b/cura/Settings/GlobalStack.py @@ -218,16 +218,16 @@ class GlobalStack(CuraContainerStack): if machine_has_heated_bed: hex_file = self.getMetaDataEntry("firmware_hbk_file", hex_file) - if hex_file: - try: - return Resources.getPath(cura.CuraApplication.CuraApplication.ResourceTypes.Firmware, hex_file.format(baudrate=baudrate)) - except FileNotFoundError: - Logger.log("w", "Firmware file %s not found.", hex_file) - return "" - else: + if not hex_file: Logger.log("w", "There is no firmware for machine %s.", self.getBottom().id) return "" + try: + return Resources.getPath(cura.CuraApplication.CuraApplication.ResourceTypes.Firmware, hex_file.format(baudrate=baudrate)) + except FileNotFoundError: + Logger.log("w", "Firmware file %s not found.", hex_file) + return "" + ## private: global_stack_mime = MimeType( name = "application/x-cura-globalstack",