Clean up unused imports

CL-541
This commit is contained in:
Jaime van Kessel 2017-12-19 16:03:48 +01:00
parent 32cbd27b70
commit b4c83814d9
2 changed files with 14 additions and 15 deletions

View file

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

View file

@ -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. # Cura is released under the terms of the LGPLv3 or higher.
from . import USBPrinterOutputDeviceManager from . import USBPrinterOutputDeviceManager
from PyQt5.QtQml import qmlRegisterType, qmlRegisterSingletonType from PyQt5.QtQml import qmlRegisterSingletonType
from UM.i18n import i18nCatalog from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("cura") i18n_catalog = i18nCatalog("cura")
def getMetaData(): def getMetaData():
return { return {}
}
def register(app): def register(app):
# We are violating the QT API here (as we use a factory, which is technically not allowed). # 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-) # 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) 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()}