From b17ff081d6bc6c63ad3909c954d964a4d358554b Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 11 Sep 2017 09:35:27 +0200 Subject: [PATCH 1/7] Added the FirmwareUpdateChecker to Cura - CURA-4224 --- .../FirmwareUpdateChecker.py | 33 ++++++++ .../FirmwareUpdateCheckerJob.py | 79 +++++++++++++++++++ plugins/FirmwareUpdateChecker/__init__.py | 14 ++++ plugins/FirmwareUpdateChecker/plugin.json | 8 ++ 4 files changed, 134 insertions(+) create mode 100644 plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py create mode 100644 plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py create mode 100644 plugins/FirmwareUpdateChecker/__init__.py create mode 100644 plugins/FirmwareUpdateChecker/plugin.json diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py new file mode 100644 index 0000000000..3b58a56481 --- /dev/null +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py @@ -0,0 +1,33 @@ +# Copyright (c) 2015 Ultimaker B.V. +# Cura is released under the terms of the AGPLv3 or higher. + +from UM.Extension import Extension +from UM.Preferences import Preferences +from UM.i18n import i18nCatalog + +from .FirmwareUpdateCheckerJob import FirmwareUpdateCheckerJob + +i18n_catalog = i18nCatalog("cura") + + +## This Extension checks for new versions of the firmware based on the latest checked version number. +# The plugin is currently only usable for applications maintained by Ultimaker. But it should be relatively easy +# to change it to work for other applications. +class FirmwareUpdateChecker(Extension): + url = "http://software.ultimaker.com/jedi/releases/latest.version" + + def __init__(self): + super().__init__() + + Preferences.getInstance().addPreference("info/latest_checked_firmware", "") + self.checkFirmwareVersion(True) + + ## Connect with software.ultimaker.com, load latest.version and check version info. + # If the version info is different from the current version, spawn a message to + # allow the user to download it. + # + # \param silent type(boolean) Suppresses messages other than "new version found" messages. + # This is used when checking for a new firmware version at startup. + def checkFirmwareVersion(self, silent = False): + job = FirmwareUpdateCheckerJob(silent = silent, url = self.url) + job.start() \ No newline at end of file diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py new file mode 100644 index 0000000000..913ac96025 --- /dev/null +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py @@ -0,0 +1,79 @@ +# Copyright (c) 2015 Ultimaker B.V. +# Cura is released under the terms of the AGPLv3 or higher. + +from UM.Preferences import Preferences +from UM.Application import Application +from UM.Message import Message +from UM.Logger import Logger +from UM.Job import Job + +import urllib.request +import codecs + +from PyQt5.QtCore import QUrl +from PyQt5.QtGui import QDesktopServices + + +from UM.i18n import i18nCatalog +i18n_catalog = i18nCatalog("cura") + + +## This job checks if there is an update available on the provided URL. +class FirmwareUpdateCheckerJob(Job): + def __init__(self, silent = False, url = None): + super().__init__() + self.silent = silent + self._url = url + self._download_url = None # If an update was found, the download_url will be set to the location of the new version. + + ## Callback for the message that is spawned when there is a new version. + def actionTriggered(self, message, action): + if action == "download": + if self._download_url is not None: + QDesktopServices.openUrl(QUrl(self._download_url)) + + def run(self): + self._download_url = None # Reset download ur. + if not self._url: + Logger.log("e", "Can not check for a new release. URL not set!") + return + + Logger.log("i", "Checking for new version of firmware") + try: + request = urllib.request.Request(self._url) + current_version_file = urllib.request.urlopen(request) + reader = codecs.getreader("utf-8") + + # Nothing to parse, just get the string + # TODO: In the future may be done by parsing a JSON file + current_version = reader(current_version_file).readline().rstrip() + Logger.log("i", "Reading firmware version: %s" % current_version) + + # If it is the first time the version is checked, the checked_version is None + checked_version = Preferences.getInstance().getValue("info/latest_checked_firmware") + active_machine = Preferences.getInstance().getValue("cura/active_machine") + # If it is not None, then we compare between the checked_version and the current_version + # Now we just do that if the active printer is Ultimaker 3 or Ultimaker 3 Extended + if ((active_machine == "Ultimaker 3 Extended") or (active_machine == "Ultimaker 3"))\ + and ((checked_version is None) or (checked_version != current_version)): + message = Message(i18n_catalog.i18nc("@info", "New %s firmware available

To ensure that your " + "%s is equiped with the latest features it is recommended " + "to update the firmware regularly. This can be done on the " + "%s (when connected to the network) or via USB." + % (active_machine, active_machine, active_machine))) + message.addAction("download", i18n_catalog.i18nc("@action:button", "Download"), "[no_icon]", "[no_description]") + + # If we do this in a cool way, the download url should be available in the JSON file + self._download_url = "https://ultimaker.com/en/resources/20500-upgrade-firmware" + message.actionTriggered.connect(self.actionTriggered) + # Sometimes it's shown, sometimes not + #message.show() + Application.getInstance().showMessage(message) + + Preferences.getInstance().setValue("info/latest_checked_firmware", current_version) + + except Exception as e: + Logger.log("w", "Failed to check for new version: %s" % e) + if not self.silent: + Message(i18n_catalog.i18nc("@info", "Could not access update information.")).show() + return \ No newline at end of file diff --git a/plugins/FirmwareUpdateChecker/__init__.py b/plugins/FirmwareUpdateChecker/__init__.py new file mode 100644 index 0000000000..5da6130772 --- /dev/null +++ b/plugins/FirmwareUpdateChecker/__init__.py @@ -0,0 +1,14 @@ +# Copyright (c) 2015 Ultimaker B.V. +# Cura is released under the terms of the AGPLv3 or higher. + +from UM.i18n import i18nCatalog +from . import FirmwareUpdateChecker + +i18n_catalog = i18nCatalog("cura") + +def getMetaData(): + return { + } + +def register(app): + return { "extension": FirmwareUpdateChecker.FirmwareUpdateChecker()} diff --git a/plugins/FirmwareUpdateChecker/plugin.json b/plugins/FirmwareUpdateChecker/plugin.json new file mode 100644 index 0000000000..d6a9f9fbd7 --- /dev/null +++ b/plugins/FirmwareUpdateChecker/plugin.json @@ -0,0 +1,8 @@ +{ + "name": "Firmware Update Checker", + "author": "Ultimaker B.V.", + "version": "1.0.0", + "description": "Checks for firmware updates.", + "api": 4, + "i18n-catalog": "cura" +} From 80992dd44c6bd6ea82beea8ef2c89f7a99c25e05 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 12 Sep 2017 17:22:17 +0200 Subject: [PATCH 2/7] The checker now runs also when the user adds a new printer - CURA-4224 --- .../FirmwareUpdateChecker.py | 21 +++++-- .../FirmwareUpdateCheckerJob.py | 55 +++++++++++-------- 2 files changed, 48 insertions(+), 28 deletions(-) diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py index 3b58a56481..f20b8be584 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py @@ -1,11 +1,14 @@ # Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. - +from UM.Application import Application from UM.Extension import Extension from UM.Preferences import Preferences +from UM.Logger import Logger from UM.i18n import i18nCatalog +from cura.Settings.GlobalStack import GlobalStack from .FirmwareUpdateCheckerJob import FirmwareUpdateCheckerJob +from UM.Settings.ContainerRegistry import ContainerRegistry i18n_catalog = i18nCatalog("cura") @@ -19,8 +22,18 @@ class FirmwareUpdateChecker(Extension): def __init__(self): super().__init__() + # Initialize the Preference called `latest_checked_firmware` that stores the last version + # checked for the UM3. In the future if we need to check other printers' firmware Preferences.getInstance().addPreference("info/latest_checked_firmware", "") - self.checkFirmwareVersion(True) + + # Listen to a Signal that indicates a change in the active printer + ContainerRegistry.getInstance().containerAdded.connect(self._onContainerAdded) + + def _onContainerAdded(self, container): + # Only take care when a new GlobaStack was added + if (isinstance(container, GlobalStack)): + Logger.log("i", "You have a '%s' in printer list. Let's check the firmware!" % container.getId()) + self.checkFirmwareVersion(container, True) ## Connect with software.ultimaker.com, load latest.version and check version info. # If the version info is different from the current version, spawn a message to @@ -28,6 +41,6 @@ class FirmwareUpdateChecker(Extension): # # \param silent type(boolean) Suppresses messages other than "new version found" messages. # This is used when checking for a new firmware version at startup. - def checkFirmwareVersion(self, silent = False): - job = FirmwareUpdateCheckerJob(silent = silent, url = self.url) + def checkFirmwareVersion(self, container = None, silent = False): + job = FirmwareUpdateCheckerJob(container = container, silent = silent, url = self.url) job.start() \ No newline at end of file diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py index 913ac96025..9e0db57ed7 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py @@ -20,8 +20,9 @@ i18n_catalog = i18nCatalog("cura") ## This job checks if there is an update available on the provided URL. class FirmwareUpdateCheckerJob(Job): - def __init__(self, silent = False, url = None): + def __init__(self, container = None, silent = False, url = None): super().__init__() + self._container = container self.silent = silent self._url = url self._download_url = None # If an update was found, the download_url will be set to the location of the new version. @@ -38,38 +39,44 @@ class FirmwareUpdateCheckerJob(Job): Logger.log("e", "Can not check for a new release. URL not set!") return - Logger.log("i", "Checking for new version of firmware") try: request = urllib.request.Request(self._url) current_version_file = urllib.request.urlopen(request) reader = codecs.getreader("utf-8") - # Nothing to parse, just get the string - # TODO: In the future may be done by parsing a JSON file - current_version = reader(current_version_file).readline().rstrip() - Logger.log("i", "Reading firmware version: %s" % current_version) + machine_name = self._container.getId() - # If it is the first time the version is checked, the checked_version is None - checked_version = Preferences.getInstance().getValue("info/latest_checked_firmware") - active_machine = Preferences.getInstance().getValue("cura/active_machine") # If it is not None, then we compare between the checked_version and the current_version - # Now we just do that if the active printer is Ultimaker 3 or Ultimaker 3 Extended - if ((active_machine == "Ultimaker 3 Extended") or (active_machine == "Ultimaker 3"))\ - and ((checked_version is None) or (checked_version != current_version)): - message = Message(i18n_catalog.i18nc("@info", "New %s firmware available

To ensure that your " - "%s is equiped with the latest features it is recommended " - "to update the firmware regularly. This can be done on the " - "%s (when connected to the network) or via USB." - % (active_machine, active_machine, active_machine))) - message.addAction("download", i18n_catalog.i18nc("@action:button", "Download"), "[no_icon]", "[no_description]") + # Now we just do that if the active printer is Ultimaker 3 or Ultimaker 3 Extended or any + # other Ultimaker 3 that will come in the future + if (machine_name[0:11] == "Ultimaker 3"): - # If we do this in a cool way, the download url should be available in the JSON file - self._download_url = "https://ultimaker.com/en/resources/20500-upgrade-firmware" - message.actionTriggered.connect(self.actionTriggered) - # Sometimes it's shown, sometimes not - #message.show() - Application.getInstance().showMessage(message) + # Nothing to parse, just get the string + # TODO: In the future may be done by parsing a JSON file with diferent version for each printer model + current_version = reader(current_version_file).readline().rstrip() + Logger.log("i", "Reading firmware version of %s: %s" % (machine_name, current_version)) + # If it is the first time the version is checked, the checked_version is None + checked_version = Preferences.getInstance().getValue("info/latest_checked_firmware") + + # If the checked_version is '', it's because is the first time we check firmware and in this case + # we will not show the notification, but we will store it for the next time + if (checked_version != "") and (checked_version != current_version): + message = Message(i18n_catalog.i18nc("@info", "New %s firmware available

To ensure that your " + "%s is equiped with the latest features it is recommended " + "to update the firmware regularly. This can be done on the " + "%s (when connected to the network) or via USB." + % (machine_name, machine_name, machine_name))) + message.addAction("download", i18n_catalog.i18nc("@action:button", "Download"), "[no_icon]", "[no_description]") + + # If we do this in a cool way, the download url should be available in the JSON file + self._download_url = "https://ultimaker.com/en/resources/20500-upgrade-firmware" + message.actionTriggered.connect(self.actionTriggered) + Application.getInstance().showMessage(message) + + # The first time we want to store the current version, the notification will not be shown, + # because the new version of Cura will be release before the firmware and we don't want to + # notify the user when no new firmware version is available. Preferences.getInstance().setValue("info/latest_checked_firmware", current_version) except Exception as e: From aa2c7c2ff6a0b4d695d3499ed043e797b940dd12 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 13 Sep 2017 10:22:07 +0200 Subject: [PATCH 3/7] Checking first if the user has enabled the 'check for updates' preference - CURA-4224 --- plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py index f20b8be584..994493a4e6 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py @@ -26,8 +26,11 @@ class FirmwareUpdateChecker(Extension): # checked for the UM3. In the future if we need to check other printers' firmware Preferences.getInstance().addPreference("info/latest_checked_firmware", "") - # Listen to a Signal that indicates a change in the active printer - ContainerRegistry.getInstance().containerAdded.connect(self._onContainerAdded) + # Listen to a Signal that indicates a change in the list of printers, just if the user has enabled the + # 'check for updates' option + Preferences.getInstance().addPreference("info/automatic_update_check", True) + if Preferences.getInstance().getValue("info/automatic_update_check"): + ContainerRegistry.getInstance().containerAdded.connect(self._onContainerAdded) def _onContainerAdded(self, container): # Only take care when a new GlobaStack was added From be57ccb127fe560fae3b7b5e66e1e6cb195d9b3f Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 13 Sep 2017 17:44:53 +0200 Subject: [PATCH 4/7] Minor fixes CURA-4224 - Fix code style - Fix typos --- .../FirmwareUpdateChecker/FirmwareUpdateChecker.py | 12 ++++++------ .../FirmwareUpdateCheckerJob.py | 10 +++++----- plugins/FirmwareUpdateChecker/__init__.py | 10 ++++++---- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py index 994493a4e6..770aace3fe 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py @@ -1,6 +1,6 @@ -# Copyright (c) 2015 Ultimaker B.V. +# Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. -from UM.Application import Application + from UM.Extension import Extension from UM.Preferences import Preferences from UM.Logger import Logger @@ -33,9 +33,9 @@ class FirmwareUpdateChecker(Extension): ContainerRegistry.getInstance().containerAdded.connect(self._onContainerAdded) def _onContainerAdded(self, container): - # Only take care when a new GlobaStack was added - if (isinstance(container, GlobalStack)): - Logger.log("i", "You have a '%s' in printer list. Let's check the firmware!" % container.getId()) + # Only take care when a new GlobalStack was added + if isinstance(container, GlobalStack): + Logger.log("i", "You have a '%s' in printer list. Let's check the firmware!", container.getId()) self.checkFirmwareVersion(container, True) ## Connect with software.ultimaker.com, load latest.version and check version info. @@ -46,4 +46,4 @@ class FirmwareUpdateChecker(Extension): # This is used when checking for a new firmware version at startup. def checkFirmwareVersion(self, container = None, silent = False): job = FirmwareUpdateCheckerJob(container = container, silent = silent, url = self.url) - job.start() \ No newline at end of file + job.start() diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py index 9e0db57ed7..b95a2b1097 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py @@ -1,4 +1,4 @@ -# Copyright (c) 2015 Ultimaker B.V. +# Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Preferences import Preferences @@ -49,12 +49,12 @@ class FirmwareUpdateCheckerJob(Job): # If it is not None, then we compare between the checked_version and the current_version # Now we just do that if the active printer is Ultimaker 3 or Ultimaker 3 Extended or any # other Ultimaker 3 that will come in the future - if (machine_name[0:11] == "Ultimaker 3"): + if machine_name[0:11] == "Ultimaker 3": # Nothing to parse, just get the string # TODO: In the future may be done by parsing a JSON file with diferent version for each printer model current_version = reader(current_version_file).readline().rstrip() - Logger.log("i", "Reading firmware version of %s: %s" % (machine_name, current_version)) + Logger.log("i", "Reading firmware version of %s: %s", machine_name, current_version) # If it is the first time the version is checked, the checked_version is None checked_version = Preferences.getInstance().getValue("info/latest_checked_firmware") @@ -80,7 +80,7 @@ class FirmwareUpdateCheckerJob(Job): Preferences.getInstance().setValue("info/latest_checked_firmware", current_version) except Exception as e: - Logger.log("w", "Failed to check for new version: %s" % e) + Logger.log("w", "Failed to check for new version: %s", e) if not self.silent: Message(i18n_catalog.i18nc("@info", "Could not access update information.")).show() - return \ No newline at end of file + return diff --git a/plugins/FirmwareUpdateChecker/__init__.py b/plugins/FirmwareUpdateChecker/__init__.py index 5da6130772..b7343dc565 100644 --- a/plugins/FirmwareUpdateChecker/__init__.py +++ b/plugins/FirmwareUpdateChecker/__init__.py @@ -1,14 +1,16 @@ -# Copyright (c) 2015 Ultimaker B.V. +# Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.i18n import i18nCatalog + from . import FirmwareUpdateChecker i18n_catalog = i18nCatalog("cura") + def getMetaData(): - return { - } + return {} + def register(app): - return { "extension": FirmwareUpdateChecker.FirmwareUpdateChecker()} + return {"extension": FirmwareUpdateChecker.FirmwareUpdateChecker()} From 9567a6921d3af0a27e5de7236b44ecbfc45c6d89 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 14 Sep 2017 08:23:26 +0200 Subject: [PATCH 5/7] Fix code style CURA-4224 --- plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py | 4 ++-- plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py index 770aace3fe..1c099705b1 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py @@ -17,7 +17,7 @@ i18n_catalog = i18nCatalog("cura") # The plugin is currently only usable for applications maintained by Ultimaker. But it should be relatively easy # to change it to work for other applications. class FirmwareUpdateChecker(Extension): - url = "http://software.ultimaker.com/jedi/releases/latest.version" + JEDI_VERSION_URL = "http://software.ultimaker.com/jedi/releases/latest.version" def __init__(self): super().__init__() @@ -45,5 +45,5 @@ class FirmwareUpdateChecker(Extension): # \param silent type(boolean) Suppresses messages other than "new version found" messages. # This is used when checking for a new firmware version at startup. def checkFirmwareVersion(self, container = None, silent = False): - job = FirmwareUpdateCheckerJob(container = container, silent = silent, url = self.url) + job = FirmwareUpdateCheckerJob(container = container, silent = silent, url = self.JEDI_VERSION_URL) job.start() diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py index b95a2b1097..a13c856742 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py @@ -13,7 +13,6 @@ import codecs from PyQt5.QtCore import QUrl from PyQt5.QtGui import QDesktopServices - from UM.i18n import i18nCatalog i18n_catalog = i18nCatalog("cura") From a48507546fa9db2aac5ba2bc0c62e94f67bd678d Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 14 Sep 2017 08:34:01 +0200 Subject: [PATCH 6/7] More defensive machine name and version check CURA-4224 --- plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py index a13c856742..352d32c0fb 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py @@ -43,13 +43,14 @@ class FirmwareUpdateCheckerJob(Job): current_version_file = urllib.request.urlopen(request) reader = codecs.getreader("utf-8") - machine_name = self._container.getId() + # get machine name from the definition container + machine_name = self._container.definition.getName().lower() + machine_name_parts = machine_name.split(" ") # If it is not None, then we compare between the checked_version and the current_version # Now we just do that if the active printer is Ultimaker 3 or Ultimaker 3 Extended or any # other Ultimaker 3 that will come in the future - if machine_name[0:11] == "Ultimaker 3": - + if len(machine_name_parts) >= 2 and machine_name_parts[:2] == ["ultimaker", "3"]: # Nothing to parse, just get the string # TODO: In the future may be done by parsing a JSON file with diferent version for each printer model current_version = reader(current_version_file).readline().rstrip() From 3812a478cf43196c0d99c2e5dc327040067cc16f Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 14 Sep 2017 12:50:53 +0200 Subject: [PATCH 7/7] Only use lowercase for string comparison CURA-4224 --- plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py index 352d32c0fb..108cfa4c0d 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py @@ -44,8 +44,8 @@ class FirmwareUpdateCheckerJob(Job): reader = codecs.getreader("utf-8") # get machine name from the definition container - machine_name = self._container.definition.getName().lower() - machine_name_parts = machine_name.split(" ") + machine_name = self._container.definition.getName() + machine_name_parts = machine_name.lower().split(" ") # If it is not None, then we compare between the checked_version and the current_version # Now we just do that if the active printer is Ultimaker 3 or Ultimaker 3 Extended or any