diff options
author | Remco Burema <r.burema@ultimaker.com> | 2018-10-12 11:11:46 +0300 |
---|---|---|
committer | Remco Burema <r.burema@ultimaker.com> | 2018-10-12 11:11:46 +0300 |
commit | 69cef98c3041244bc9edb77ffe3f8c85f517ba19 (patch) | |
tree | 03645e731f21aa21cbf5a75e54cdb5c804999b88 /plugins/FirmwareUpdateChecker | |
parent | f2b50c748c1aea35e61de119fb3a08a28afdb295 (diff) |
FirmwareUpdateChecker: Small fixes (typing and lowercase input).
Diffstat (limited to 'plugins/FirmwareUpdateChecker')
-rw-r--r-- | plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py | 5 | ||||
-rw-r--r-- | plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerLookup.py | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py index d186cbb4e4..09be95597b 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py @@ -39,9 +39,8 @@ class FirmwareUpdateCheckerJob(Job): try: request = urllib.request.Request(url, headers=self._headers) - current_version_file = urllib.request.urlopen(request) - reader = codecs.getreader("utf-8") - result = reader(current_version_file).read(firstline=True) + response = urllib.request.urlopen(request) + result = response.read().decode('utf-8') except URLError: Logger.log('w', "Could not reach '{0}', if this URL is old, consider removal.".format(url)) diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerLookup.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerLookup.py index f6d7a24da0..2e97a8869d 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerLookup.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerLookup.py @@ -42,7 +42,7 @@ class FirmwareUpdateCheckerLookup: try: for machine_json in machines_json: machine_id = machine_json.get("id") - machine_name = machine_json.get("name") + machine_name = machine_json.get("name").lower() # Lower in case upper-case char are added to the json. self._machine_ids.append(machine_id) self._machine_per_name[machine_name] = machine_id version_parse_function = \ |