diff --git a/cura/ConvexHullNode.py b/cura/ConvexHullNode.py index b99e80fcff6..1c3d8f88dbc 100644 --- a/cura/ConvexHullNode.py +++ b/cura/ConvexHullNode.py @@ -33,7 +33,7 @@ def __init__(self, node, hull, parent = None): self._convex_hull_head_mesh = None self._hull = hull - hull_points = self._hull.getPoints() + hull_points = self._hull.getPoints() # TODO: @UnusedVariable hull_mesh = self.createHullMesh(self._hull.getPoints()) if hull_mesh: self.setMeshData(hull_mesh) diff --git a/cura/CuraActions.py b/cura/CuraActions.py index 36bf32fdd77..dd11eb2b979 100644 --- a/cura/CuraActions.py +++ b/cura/CuraActions.py @@ -1,4 +1,4 @@ -from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, QUrl +from PyQt5.QtCore import QObject, pyqtSlot, QUrl from PyQt5.QtGui import QDesktopServices from UM.Event import CallFunctionEvent diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 0f35a3dd982..e5813fb7906 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -6,22 +6,16 @@ from UM.Scene.Camera import Camera from UM.Scene.Platform import Platform from UM.Math.Vector import Vector -from UM.Math.Matrix import Matrix from UM.Math.Quaternion import Quaternion from UM.Math.AxisAlignedBox import AxisAlignedBox from UM.Resources import Resources from UM.Scene.ToolHandle import ToolHandle from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator -from UM.Mesh.WriteMeshJob import WriteMeshJob from UM.Mesh.ReadMeshJob import ReadMeshJob from UM.Logger import Logger from UM.Preferences import Preferences -from UM.Message import Message -from UM.PluginRegistry import PluginRegistry from UM.JobQueue import JobQueue -from UM.Math.Polygon import Polygon -from UM.Scene.BoxRenderer import BoxRenderer from UM.Scene.Selection import Selection from UM.Scene.GroupDecorator import GroupDecorator @@ -41,7 +35,7 @@ from . import ZOffsetDecorator from . import CuraSplashScreen -from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS +from PyQt5.QtCore import pyqtSlot, QUrl, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS from PyQt5.QtGui import QColor, QIcon from PyQt5.QtQml import qmlRegisterUncreatableType @@ -353,7 +347,7 @@ def multiplyObject(self, object_id, count): if node: op = GroupedOperation() - for i in range(count): + for _ in range(count): if node.getParent() and node.getParent().callDecoration("isGroup"): new_node = copy.deepcopy(node.getParent()) #Copy the group node. new_node.callDecoration("setConvexHull",None) @@ -528,6 +522,7 @@ def mergeSelected(self): try: group_node = Selection.getAllSelectedObjects()[0] except Exception as e: + Logger.log("d", "mergeSelected: Exception:", e) return multi_material_decorator = MultiMaterialDecorator.MultiMaterialDecorator() group_node.addDecorator(multi_material_decorator) diff --git a/cura/LayerData.py b/cura/LayerData.py index 90529e63eaa..dc9b4faa0ec 100644 --- a/cura/LayerData.py +++ b/cura/LayerData.py @@ -7,8 +7,6 @@ from UM.Math.Vector import Vector import numpy -import math -import copy class LayerData(MeshData): def __init__(self): @@ -20,11 +18,11 @@ def addLayer(self, layer): if layer not in self._layers: self._layers[layer] = Layer(layer) - def addPolygon(self, layer, type, data, line_width): + def addPolygon(self, layer, polygon_type, data, line_width): if layer not in self._layers: self.addLayer(layer) - p = Polygon(self, type, data, line_width) + p = Polygon(self, polygon_type, data, line_width) self._layers[layer].polygons.append(p) def getLayer(self, layer): @@ -69,8 +67,8 @@ def build(self): self.addIndices(indices.flatten()) class Layer(): - def __init__(self, id): - self._id = id + def __init__(self, layer_id): + self._id = layer_id self._height = 0.0 self._thickness = 0.0 self._polygons = [] @@ -173,9 +171,9 @@ class Polygon(): MoveCombingType = 8 MoveRetractionType = 9 - def __init__(self, mesh, type, data, line_width): + def __init__(self, mesh, polygon_type, data, line_width): self._mesh = mesh - self._type = type + self._type = polygon_type self._data = data self._line_width = line_width / 1000 diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index f660d68f34d..b8934b87969 100644 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -5,8 +5,6 @@ from UM.Scene.SceneNode import SceneNode from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator -from UM.Operations.TranslateOperation import TranslateOperation -from UM.Math.Float import Float from UM.Math.Vector import Vector from UM.Math.AxisAlignedBox import AxisAlignedBox from UM.Application import Application diff --git a/cura/PlatformPhysicsOperation.py b/cura/PlatformPhysicsOperation.py index c307ae5ae91..5d2089e8af5 100644 --- a/cura/PlatformPhysicsOperation.py +++ b/cura/PlatformPhysicsOperation.py @@ -2,8 +2,6 @@ # Cura is released under the terms of the AGPLv3 or higher. from UM.Operations.Operation import Operation -from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation -from UM.Operations.TranslateOperation import TranslateOperation from UM.Operations.GroupedOperation import GroupedOperation ## A specialised operation designed specifically to modify the previous operation. diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 73dde534379..d3eaab662c5 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -1,11 +1,9 @@ # Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. -from PyQt5.QtCore import QObject, QDateTime, QTimer, pyqtSignal, pyqtSlot, pyqtProperty +from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty from UM.Application import Application -from UM.Resources import Resources -from UM.Scene.SceneNode import SceneNode from UM.Qt.Duration import Duration import math diff --git a/plugins/ChangeLogPlugin/ChangeLog.py b/plugins/ChangeLogPlugin/ChangeLog.py index 7586268aa64..b1f65a00350 100644 --- a/plugins/ChangeLogPlugin/ChangeLog.py +++ b/plugins/ChangeLogPlugin/ChangeLog.py @@ -42,7 +42,7 @@ def getChangeLogs(self): @pyqtSlot(result = str) def getChangeLogString(self): logs = self.getChangeLogs() - latest_version = Version(Preferences.getInstance().getValue("general/latest_version_changelog_shown")) + latest_version = Version(Preferences.getInstance().getValue("general/latest_version_changelog_shown")) #TODO: @UnusedVariable result = "" for version in logs: result += "

" + str(version) + "


" diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 7f7b9924046..70feba9974f 100644 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -4,25 +4,19 @@ from UM.Backend.Backend import Backend from UM.Application import Application from UM.Scene.SceneNode import SceneNode -from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.Preferences import Preferences -from UM.Math.Vector import Vector from UM.Signal import Signal from UM.Logger import Logger from UM.Qt.Bindings.BackendProxy import BackendState #To determine the state of the slicing job. -from UM.Resources import Resources -from UM.Settings.SettingOverrideDecorator import SettingOverrideDecorator from UM.Message import Message from UM.PluginRegistry import PluginRegistry -from cura.OneAtATimeIterator import OneAtATimeIterator from . import ProcessSlicedObjectListJob from . import ProcessGCodeJob from . import StartSliceJob import os import sys -import numpy from PyQt5.QtCore import QTimer diff --git a/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py b/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py index df2e5966e96..6bd8d165b3a 100644 --- a/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py +++ b/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py @@ -16,7 +16,6 @@ from cura import LayerDataDecorator import numpy -import struct catalog = i18nCatalog("cura") @@ -51,7 +50,7 @@ def run(self): object_id_map = {} new_node = SceneNode() - ## Put all nodes in a dict identified by ID + ## Put all nodes in a dictionary identified by ID for node in DepthFirstIterator(self._scene.getRoot()): if type(node) is SceneNode and node.getMeshData(): if node.callDecoration("getLayerData"): @@ -74,15 +73,15 @@ def run(self): layer_count += self._message.getRepeatedMessage("objects", i).repeatedMessageCount("layers") current_layer = 0 - for i in range(self._message.repeatedMessageCount("objects")): - object = self._message.getRepeatedMessage("objects", i) + for object_position in range(self._message.repeatedMessageCount("objects")): + current_object = self._message.getRepeatedMessage("objects", object_position) try: - node = object_id_map[object.id] + node = object_id_map[current_object.id] except KeyError: continue - for l in range(object.repeatedMessageCount("layers")): - layer = object.getRepeatedMessage("layers", l) + for l in range(current_object.repeatedMessageCount("layers")): + layer = current_object.getRepeatedMessage("layers", l) layer_data.addLayer(layer.id) layer_data.setLayerHeight(layer.id, layer.height) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 7c35bca36b8..098808dbfe1 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -87,11 +87,11 @@ def run(self): group_message = slice_message.addRepeatedMessage("object_lists") if group[0].getParent().callDecoration("isGroup"): self._handlePerObjectSettings(group[0].getParent(), group_message) - for object in group: - mesh_data = object.getMeshData().getTransformed(object.getWorldTransformation()) + for current_object in group: + mesh_data = current_object.getMeshData().getTransformed(current_object.getWorldTransformation()) obj = group_message.addRepeatedMessage("objects") - obj.id = id(object) + obj.id = id(current_object) verts = numpy.array(mesh_data.getVertices()) verts[:,[1,2]] = verts[:,[2,1]] @@ -99,7 +99,7 @@ def run(self): obj.vertices = verts - self._handlePerObjectSettings(object, obj) + self._handlePerObjectSettings(current_object, obj) Job.yieldThread() diff --git a/plugins/CuraProfileReader/CuraProfileReader.py b/plugins/CuraProfileReader/CuraProfileReader.py index 9addec68d2f..e3001da6ae7 100644 --- a/plugins/CuraProfileReader/CuraProfileReader.py +++ b/plugins/CuraProfileReader/CuraProfileReader.py @@ -2,6 +2,7 @@ # Cura is released under the terms of the AGPLv3 or higher. from UM.Application import Application #To get the machine manager to create the new profile in. +from UM.Logger import Logger from UM.Settings.Profile import Profile from UM.Settings.ProfileReader import ProfileReader diff --git a/plugins/CuraProfileWriter/CuraProfileWriter.py b/plugins/CuraProfileWriter/CuraProfileWriter.py index 479b84f37ed..1ac206e54a2 100644 --- a/plugins/CuraProfileWriter/CuraProfileWriter.py +++ b/plugins/CuraProfileWriter/CuraProfileWriter.py @@ -4,7 +4,6 @@ from UM.Logger import Logger from UM.SaveFile import SaveFile -from UM.Settings.Profile import Profile from UM.Settings.ProfileWriter import ProfileWriter ## Writes profiles to Cura's own profile format with config files. diff --git a/plugins/GCodeWriter/GCodeWriter.py b/plugins/GCodeWriter/GCodeWriter.py index 0a76a51742a..e481e4c1877 100644 --- a/plugins/GCodeWriter/GCodeWriter.py +++ b/plugins/GCodeWriter/GCodeWriter.py @@ -4,7 +4,6 @@ from UM.Mesh.MeshWriter import MeshWriter from UM.Logger import Logger from UM.Application import Application -import io import re #For escaping characters in the settings. import copy diff --git a/plugins/ImageReader/ImageReader.py b/plugins/ImageReader/ImageReader.py index 4aa6a664391..0d6c12b13dd 100644 --- a/plugins/ImageReader/ImageReader.py +++ b/plugins/ImageReader/ImageReader.py @@ -1,7 +1,6 @@ # Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. -import os import numpy from PyQt5.QtGui import QImage, qRed, qGreen, qBlue @@ -49,8 +48,8 @@ def read(self, file_name): return self._generateSceneNode(file_name, size, self._ui.peak_height, self._ui.base_height, self._ui.smoothing, 512, self._ui.image_color_invert) def _generateSceneNode(self, file_name, xz_size, peak_height, base_height, blur_iterations, max_size, image_color_invert): - mesh = None - scene_node = None + mesh = None # TODO: @UnusedVariable + scene_node = None # TODO: @UnusedVariable scene_node = SceneNode() @@ -111,7 +110,7 @@ def _generateSceneNode(self, file_name, xz_size, peak_height, base_height, blur_ if image_color_invert: height_data = 1 - height_data - for i in range(0, blur_iterations): + for _ in range(0, blur_iterations): copy = numpy.pad(height_data, ((1, 1), (1, 1)), mode= "edge") height_data += copy[1:-1, 2:] diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index eb9c3bc91e7..97a2a0ab305 100644 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -136,7 +136,7 @@ def setLayer(self, value): def calculateMaxLayers(self): scene = self.getController().getScene() - renderer = self.getRenderer() # TODO: Unused variable + renderer = self.getRenderer() # TODO: @UnusedVariable self._activity = True self._old_max_layers = self._max_layers diff --git a/plugins/RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py b/plugins/RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py index 4b65ce024da..cee4f40430a 100644 --- a/plugins/RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py +++ b/plugins/RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py @@ -58,7 +58,7 @@ def _findInTree(self, t, n): if type(t) is dict: if "_name" in t and t["_name"] == n: ret.append(t) - for k, v in t.items(): + for k, v in t.items(): # TODO: @UnusedVariable "k" ret += self._findInTree(v, n) if type(t) is list: for v in t: diff --git a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py index f73ba46c85a..3644ae54ca8 100644 --- a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py +++ b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py @@ -8,7 +8,6 @@ from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator from UM.OutputDevice.OutputDevice import OutputDevice from UM.OutputDevice import OutputDeviceError -from UM.Preferences import Preferences from UM.i18n import i18nCatalog catalog = i18nCatalog("cura") diff --git a/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py b/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py index 1a095e2a687..6ab095f338c 100644 --- a/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py +++ b/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py @@ -4,7 +4,6 @@ import threading import time -from UM.Signal import Signal from UM.Message import Message from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin diff --git a/plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py b/plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py index b47a37d35c1..0df38dbf743 100644 --- a/plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py +++ b/plugins/RemovableDriveOutputDevice/WindowsRemovableDrivePlugin.py @@ -2,21 +2,13 @@ # Copyright (c) 2013 David Braam # Uranium is released under the terms of the AGPLv3 or higher. +from UM.i18n import i18nCatalog +catalog = i18nCatalog("cura") + from . import RemovableDrivePlugin -import threading import string - -from ctypes import windll -from ctypes import wintypes - import ctypes -import time -import os -import subprocess - -from UM.i18n import i18nCatalog -catalog = i18nCatalog("cura") # WinAPI Constants that we need # Hardcoded here due to stupid WinDLL stuff that does not give us access to these values. @@ -37,7 +29,7 @@ class WindowsRemovableDrivePlugin(RemovableDrivePlugin.RemovableDrivePlugin): def checkRemovableDrives(self): drives = {} - bitmask = windll.kernel32.GetLogicalDrives() + bitmask = ctypes.windll.kernel32.GetLogicalDrives() # Check possible drive letters, from A to Z # Note: using ascii_uppercase because we do not want this to change with locale! for letter in string.ascii_uppercase: @@ -45,11 +37,11 @@ def checkRemovableDrives(self): # Do we really want to skip A and B? # GetDriveTypeA explicitly wants a byte array of type ascii. It will accept a string, but this wont work - if bitmask & 1 and windll.kernel32.GetDriveTypeA(drive.encode("ascii")) == DRIVE_REMOVABLE: + if bitmask & 1 and ctypes.windll.kernel32.GetDriveTypeA(drive.encode("ascii")) == DRIVE_REMOVABLE: volume_name = "" name_buffer = ctypes.create_unicode_buffer(1024) filesystem_buffer = ctypes.create_unicode_buffer(1024) - error = windll.kernel32.GetVolumeInformationW(ctypes.c_wchar_p(drive), name_buffer, ctypes.sizeof(name_buffer), None, None, None, filesystem_buffer, ctypes.sizeof(filesystem_buffer)) + error = ctypes.windll.kernel32.GetVolumeInformationW(ctypes.c_wchar_p(drive), name_buffer, ctypes.sizeof(name_buffer), None, None, None, filesystem_buffer, ctypes.sizeof(filesystem_buffer)) if error != 0: volume_name = name_buffer.value @@ -66,7 +58,7 @@ def checkRemovableDrives(self): # Check for the free space. Some card readers show up as a drive with 0 space free when there is no card inserted. free_bytes = ctypes.c_longlong(0) - if windll.kernel32.GetDiskFreeSpaceExA(drive.encode("ascii"), ctypes.byref(free_bytes), None, None) == 0: + if ctypes.windll.kernel32.GetDiskFreeSpaceExA(drive.encode("ascii"), ctypes.byref(free_bytes), None, None) == 0: continue if free_bytes.value < 1: @@ -80,19 +72,19 @@ def checkRemovableDrives(self): def performEjectDevice(self, device): # Magic WinAPI stuff # First, open a handle to the Device - handle = windll.kernel32.CreateFileA("\\\\.\\{0}".format(device.getId()[:-1]).encode("ascii"), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, None, OPEN_EXISTING, 0, None ) + handle = ctypes.windll.kernel32.CreateFileA("\\\\.\\{0}".format(device.getId()[:-1]).encode("ascii"), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, None, OPEN_EXISTING, 0, None ) if handle == -1: - print(windll.kernel32.GetLastError()) + print(ctypes.windll.kernel32.GetLastError()) return result = None # Then, try and tell it to eject - if not windll.kernel32.DeviceIoControl(handle, IOCTL_STORAGE_EJECT_MEDIA, None, None, None, None, None, None): + if not ctypes.windll.kernel32.DeviceIoControl(handle, IOCTL_STORAGE_EJECT_MEDIA, None, None, None, None, None, None): result = False else: result = True # Finally, close the handle - windll.kernel32.CloseHandle(handle) + ctypes.windll.kernel32.CloseHandle(handle) return result diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index ed018f7d89f..c2e8b9a147c 100644 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -66,7 +66,7 @@ def _onWriteStarted(self, output_device): break - profile_values = settings.getChangedSettings() # TODO: Unused variable + profile_values = settings.getChangedSettings() # TODO: @UnusedVariable # Get total material used (in mm^3) print_information = Application.getInstance().getPrintInformation() diff --git a/plugins/SolidView/SolidView.py b/plugins/SolidView/SolidView.py index 607455c7b33..8719e9c6e48 100644 --- a/plugins/SolidView/SolidView.py +++ b/plugins/SolidView/SolidView.py @@ -5,7 +5,6 @@ from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.Resources import Resources from UM.Application import Application -from UM.Math.Color import Color from UM.Preferences import Preferences from UM.View.Renderer import Renderer diff --git a/plugins/USBPrinting/PrinterConnection.py b/plugins/USBPrinting/PrinterConnection.py index d28324b71cc..1e5aa89b42e 100644 --- a/plugins/USBPrinting/PrinterConnection.py +++ b/plugins/USBPrinting/PrinterConnection.py @@ -12,10 +12,8 @@ from UM.Application import Application from UM.Signal import Signal, SignalEmitter -from UM.Resources import Resources from UM.Logger import Logger from UM.OutputDevice.OutputDevice import OutputDevice -from UM.OutputDevice import OutputDeviceError from UM.PluginRegistry import PluginRegistry from PyQt5.QtQuick import QQuickView @@ -337,6 +335,7 @@ def close(self): try: self._connect_thread.join() except Exception as e: + Logger.log("d", "PrinterConnection.close: %s (expected)", e) pass # This should work, but it does fail sometimes for some reason self._connect_thread = threading.Thread(target=self._connect) @@ -374,7 +373,7 @@ def moveHead(self, x, y, z): @pyqtSlot() def homeHead(self): - self._sendCommand("G28") + self._sendCommand("G28") ## Directly send the command, withouth checking connection state (eg; printing). # \param cmd string with g-code @@ -457,6 +456,7 @@ def _setExtruderTemperature(self, index, temperature): self._extruder_temperatures[index] = temperature self.extruderTemperatureChanged.emit() except Exception as e: + Logger.log("d", "PrinterConnection._setExtruderTemperature: ", e) pass ## Private function to set the temperature of the bed. diff --git a/plugins/USBPrinting/USBPrinterManager.py b/plugins/USBPrinting/USBPrinterManager.py index fbcd6201d77..d6836468abe 100644 --- a/plugins/USBPrinting/USBPrinterManager.py +++ b/plugins/USBPrinting/USBPrinterManager.py @@ -4,8 +4,6 @@ from UM.Signal import Signal, SignalEmitter from . import PrinterConnection from UM.Application import Application -from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator -from UM.Scene.SceneNode import SceneNode from UM.Resources import Resources from UM.Logger import Logger from UM.PluginRegistry import PluginRegistry @@ -20,7 +18,6 @@ import glob import time import os.path -import sys from UM.Extension import Extension from PyQt5.QtQuick import QQuickView @@ -59,7 +56,7 @@ def __init__(self, parent = None): @pyqtProperty(float, notify = progressChanged) def progress(self): progress = 0 - for printer_name, connection in self._printer_connections.items(): + for printer_name, connection in self._printer_connections.items(): # TODO: @UnusedVariable "printer_name" progress += connection.progress return progress / len(self._printer_connections) @@ -231,6 +228,7 @@ def getSerialPortList(self, only_list_usb = False): base_list += [values[1]] i += 1 except Exception as e: + Logger.log("d", "USBPrinterManager.getSerialPortList: ", e) pass else: if only_list_usb: diff --git a/setup.py b/setup.py index f5b3c3e1061..1eeca36ed66 100644 --- a/setup.py +++ b/setup.py @@ -4,10 +4,9 @@ from distutils.core import setup import py2exe import UM -import UM.Qt -import cura +import UM.Qt #@UnusedImport +import cura #@UnusedImport import os -import re import shutil import site @@ -74,4 +73,4 @@ def copytree(src, dst, symlinks=False, ignore=None): print("Copying Angle libraries from %s" % qt_origin_path) shutil.copy(os.path.join(qt_origin_path, "libEGL.dll"), "dist/libEGL.dll") shutil.copy(os.path.join(qt_origin_path, "libGLESv2.dll"), "dist/libGLESv2.dll") -os.rename("dist/cura_app.exe", "dist/Cura.exe") \ No newline at end of file +os.rename("dist/cura_app.exe", "dist/Cura.exe")