Browse Source

Clean up unused imports

CL-541
Jaime van Kessel 7 years ago
parent
commit
b4c83814d9

+ 8 - 10
plugins/USBPrinting/USBPrinterOutputDeviceManager.py

@@ -2,32 +2,29 @@
 # Cura is released under the terms of the LGPLv3 or higher.
 
 from UM.Signal import Signal, signalemitter
-from . import USBPrinterOutputDevice
 from UM.Application import Application
 from UM.Resources import Resources
 from UM.Logger import Logger
 from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
-from cura.PrinterOutputDevice import ConnectionState
-from UM.Qt.ListModel import ListModel
-from UM.Message import Message
+from UM.i18n import i18nCatalog
 
+from cura.PrinterOutputDevice import ConnectionState
 from cura.CuraApplication import CuraApplication
 
+from . import USBPrinterOutputDevice
+from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal
+
 import threading
 import platform
 import time
-import os.path
 import serial.tools.list_ports
-from UM.Extension import Extension
 
-from PyQt5.QtCore import QUrl, QObject, pyqtSlot, pyqtProperty, pyqtSignal, Qt
-from UM.i18n import i18nCatalog
 i18n_catalog = i18nCatalog("cura")
 
 
 ##  Manager class that ensures that a usbPrinteroutput device is created for every connected USB printer.
 @signalemitter
-class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin, Extension):
+class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin):
     addUSBOutputDeviceSignal = Signal()
     progressChanged = pyqtSignal()
 
@@ -42,7 +39,8 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin, Extension):
         self._check_updates = True
 
         Application.getInstance().applicationShuttingDown.connect(self.stop)
-        self.addUSBOutputDeviceSignal.connect(self.addOutputDevice) #Because the model needs to be created in the same thread as the QMLEngine, we use a signal.
+        # Because the model needs to be created in the same thread as the QMLEngine, we use a signal.
+        self.addUSBOutputDeviceSignal.connect(self.addOutputDevice)
 
     def start(self):
         self._check_updates = True

+ 6 - 5
plugins/USBPrinting/__init__.py

@@ -1,17 +1,18 @@
-# Copyright (c) 2015 Ultimaker B.V.
+# Copyright (c) 2017 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 from . import USBPrinterOutputDeviceManager
-from PyQt5.QtQml import qmlRegisterType, qmlRegisterSingletonType
+from PyQt5.QtQml import qmlRegisterSingletonType
 from UM.i18n import i18nCatalog
 i18n_catalog = i18nCatalog("cura")
 
+
 def getMetaData():
-    return {
-    }
+    return {}
+
 
 def register(app):
     # We are violating the QT API here (as we use a factory, which is technically not allowed).
     # but we don't really have another means for doing this (and it seems to you know -work-)
     qmlRegisterSingletonType(USBPrinterOutputDeviceManager.USBPrinterOutputDeviceManager, "Cura", 1, 0, "USBPrinterManager", USBPrinterOutputDeviceManager.USBPrinterOutputDeviceManager.getInstance)
-    return {"extension":USBPrinterOutputDeviceManager.USBPrinterOutputDeviceManager.getInstance(), "output_device": USBPrinterOutputDeviceManager.USBPrinterOutputDeviceManager.getInstance()}
+    return {"output_device": USBPrinterOutputDeviceManager.USBPrinterOutputDeviceManager.getInstance()}