diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index f0e9727908..3009f75d8f 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -142,7 +142,7 @@ class CuraApplication(QtApplication): parser.add_argument("--debug", dest="debug-mode", action="store_true", default=False, help="Enable detailed crash reports.") def run(self): - if not "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION" in os.environ or os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] != "cpp": + if "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION" not in os.environ or os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] != "cpp": Logger.log("w", "Using Python implementation of Protobuf, expect bad performance!") self._i18n_catalog = i18nCatalog("cura"); diff --git a/plugins/3MFReader/ThreeMFReader.py b/plugins/3MFReader/ThreeMFReader.py index 033fca69aa..bdbc9a81d3 100644 --- a/plugins/3MFReader/ThreeMFReader.py +++ b/plugins/3MFReader/ThreeMFReader.py @@ -37,7 +37,7 @@ class ThreeMFReader(MeshReader): if extension.lower() == self._supported_extension: result = SceneNode() # The base object of 3mf is a zipped archive. - archive = zipfile.ZipFile(file_name, 'r') + archive = zipfile.ZipFile(file_name, "r") try: root = ET.parse(archive.open("3D/3dmodel.model")) diff --git a/plugins/3MFReader/__init__.py b/plugins/3MFReader/__init__.py index 7d9b00a74e..9d7bf57100 100644 --- a/plugins/3MFReader/__init__.py +++ b/plugins/3MFReader/__init__.py @@ -2,10 +2,10 @@ # Cura is released under the terms of the AGPLv3 or higher. from UM.i18n import i18nCatalog -catalog = i18nCatalog("cura") - from . import ThreeMFReader +catalog = i18nCatalog("cura") + def getMetaData(): return { "plugin": { diff --git a/plugins/ChangeLogPlugin/ChangeLog.py b/plugins/ChangeLogPlugin/ChangeLog.py index 4d4c3762f6..7586268aa6 100644 --- a/plugins/ChangeLogPlugin/ChangeLog.py +++ b/plugins/ChangeLogPlugin/ChangeLog.py @@ -58,7 +58,7 @@ class ChangeLog(Extension, QObject,): def loadChangeLogs(self): self._change_logs = collections.OrderedDict() - with open(os.path.join(PluginRegistry.getInstance().getPluginPath("ChangeLogPlugin"), "ChangeLog.txt"), 'r',-1, "utf-8") as f: + with open(os.path.join(PluginRegistry.getInstance().getPluginPath("ChangeLogPlugin"), "ChangeLog.txt"), "r",-1, "utf-8") as f: open_version = None open_header = None for line in f: diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 604d2a9ad6..8fa5441d1a 100644 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -125,7 +125,7 @@ class CuraEngineBackend(Backend): return if self._profile.hasErrorValue(): - Logger.log('w', "Profile has error values. Aborting slicing") + Logger.log("w", "Profile has error values. Aborting slicing") if self._message: self._message.hide() self._message = None diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 32ffb1fe96..7fd703f8ca 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -18,7 +18,7 @@ from . import Cura_pb2 ## Formatter class that handles token expansion in start/end gcod class GcodeStartEndFormatter(Formatter): - def get_value(self, key, args, kwargs): + def get_value(self, key, args, kwargs): # [CodeStyle: get_value is an overridden function from the Formatter class] if isinstance(key, str): try: return kwargs[key] @@ -118,8 +118,8 @@ class StartSliceJob(Job): msg = Cura_pb2.SettingList() settings = profile.getAllSettingValues(include_machine = True) start_gcode = settings["machine_start_gcode"] - settings["material_bed_temp_prepend"] = not "{material_bed_temperature}" in start_gcode - settings["material_print_temp_prepend"] = not "{material_print_temperature}" in start_gcode + settings["material_bed_temp_prepend"] = "{material_bed_temperature}" not in start_gcode + settings["material_print_temp_prepend"] = "{material_print_temperature}" not in start_gcode for key, value in settings.items(): s = msg.settings.add() s.name = key diff --git a/plugins/GCodeReader/__init__.py b/plugins/GCodeReader/__init__.py index c2b5384b32..3234957902 100644 --- a/plugins/GCodeReader/__init__.py +++ b/plugins/GCodeReader/__init__.py @@ -2,10 +2,10 @@ # Cura is released under the terms of the AGPLv3 or higher. from UM.i18n import i18nCatalog -catalog = i18nCatalog("cura") - from . import GCodeReader +catalog = i18nCatalog("cura") + def getMetaData(): return { "plugin": { diff --git a/plugins/LayerView/LayerViewProxy.py b/plugins/LayerView/LayerViewProxy.py index 911094ae69..a74ea33d85 100644 --- a/plugins/LayerView/LayerViewProxy.py +++ b/plugins/LayerView/LayerViewProxy.py @@ -1,6 +1,8 @@ from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot, pyqtProperty from UM.Application import Application + import LayerView + class LayerViewProxy(QObject): def __init__(self, parent = None): super().__init__(parent) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 001c2f90f6..20ba21f991 100644 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -110,7 +110,7 @@ class SliceInfo(Extension): # Convert data to bytes submitted_data = urllib.parse.urlencode(submitted_data) - binary_data = submitted_data.encode('utf-8') + binary_data = submitted_data.encode("utf-8") # Submit data try: diff --git a/plugins/USBPrinting/PrinterConnection.py b/plugins/USBPrinting/PrinterConnection.py index 341fe425b1..c19603c945 100644 --- a/plugins/USBPrinting/PrinterConnection.py +++ b/plugins/USBPrinting/PrinterConnection.py @@ -471,17 +471,17 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter): self.showControlInterface() def _setEndstopState(self, endstop_key, value): - if endstop_key == b'x_min': + if endstop_key == b"x_min": if self._x_min_endstop_pressed != value: - self.endstopStateChanged.emit('x_min', value) + self.endstopStateChanged.emit("x_min", value) self._x_min_endstop_pressed = value - elif endstop_key == b'y_min': + elif endstop_key == b"y_min": if self._y_min_endstop_pressed != value: - self.endstopStateChanged.emit('y_min', value) + self.endstopStateChanged.emit("y_min", value) self._y_min_endstop_pressed = value - elif endstop_key == b'z_min': + elif endstop_key == b"z_min": if self._z_min_endstop_pressed != value: - self.endstopStateChanged.emit('z_min', value) + self.endstopStateChanged.emit("z_min", value) self._z_min_endstop_pressed = value ## Listen thread function. @@ -528,8 +528,8 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter): pass #TODO: temperature changed callback elif b"_min" in line or b"_max" in line: - tag, value = line.split(b':', 1) - self._setEndstopState(tag,(b'H' in value or b'TRIGGERED' in value)) + tag, value = line.split(b":", 1) + self._setEndstopState(tag,(b"H" in value or b"TRIGGERED" in value)) if self._is_printing: if line == b"" and time.time() > ok_timeout: