Browse Source

Remove a bunch of unused imports

Jaime van Kessel 5 years ago
parent
commit
00078fd659

+ 0 - 1
cura/BuildVolume.py

@@ -26,7 +26,6 @@ catalog = i18nCatalog("cura")
 
 import numpy
 import math
-import copy
 
 from typing import List, Optional, TYPE_CHECKING, Any, Set, cast, Iterable, Dict
 

+ 1 - 1
cura/CuraApplication.py

@@ -1796,7 +1796,7 @@ class CuraApplication(QtApplication):
         try:
             result = workspace_reader.preRead(file_path, show_dialog=False)
             return result == WorkspaceReader.PreReadResult.accepted
-        except Exception as e:
+        except Exception:
             Logger.logException("e", "Could not check file %s", file_url)
             return False
 

+ 1 - 6
cura/Machines/Models/BuildPlateModel.py

@@ -2,13 +2,8 @@
 # Cura is released under the terms of the LGPLv3 or higher.
 
 from PyQt5.QtCore import Qt
-
-from UM.Application import Application
 from UM.Logger import Logger
 from UM.Qt.ListModel import ListModel
-from UM.Util import parseBool
-
-from cura.Machines.VariantType import VariantType
 
 
 class BuildPlateModel(ListModel):
@@ -26,4 +21,4 @@ class BuildPlateModel(ListModel):
     def _update(self):
         Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
         self.setItems([])
-        return
+        return

+ 0 - 1
cura/Machines/Models/DiscoveredPrintersModel.py

@@ -11,7 +11,6 @@ from UM.Util import parseBool
 from UM.OutputDevice.OutputDeviceManager import ManualDeviceAdditionAttempt
 
 if TYPE_CHECKING:
-    from PyQt5.QtCore import QObject
     from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
     from cura.CuraApplication import CuraApplication
     from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutputDevice

+ 1 - 2
cura/Machines/VariantNode.py

@@ -1,13 +1,12 @@
 # Copyright (c) 2019 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
-from typing import Optional, TYPE_CHECKING
+from typing import TYPE_CHECKING
 
 from UM.Logger import Logger
 from UM.Settings.ContainerRegistry import ContainerRegistry
 from UM.Settings.Interfaces import ContainerInterface
 from UM.Signal import Signal
 
-from cura.Settings.cura_empty_instance_containers import empty_variant_container
 from cura.Machines.ContainerNode import ContainerNode
 from cura.Machines.MaterialNode import MaterialNode
 

+ 0 - 2
cura/OAuth2/AuthorizationService.py

@@ -3,7 +3,6 @@
 
 import json
 from datetime import datetime, timedelta
-import os
 from typing import Optional, TYPE_CHECKING
 from urllib.parse import urlencode
 
@@ -14,7 +13,6 @@ from PyQt5.QtGui import QDesktopServices
 
 from UM.Logger import Logger
 from UM.Message import Message
-from UM.Platform import Platform
 from UM.Signal import Signal
 
 from cura.OAuth2.LocalAuthorizationServer import LocalAuthorizationServer

+ 1 - 2
cura/Settings/ExtruderManager.py

@@ -12,7 +12,6 @@ from UM.Scene.SceneNode import SceneNode
 from UM.Scene.Selection import Selection
 from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator
 from UM.Settings.ContainerRegistry import ContainerRegistry  # Finding containers by ID.
-from UM.Decorators import deprecated
 
 from typing import Any, cast, Dict, List, Optional, TYPE_CHECKING, Union
 
@@ -369,7 +368,7 @@ class ExtruderManager(QObject):
                 printer = global_stack.getId(), expected = expected_extruder_definition_0_id, got = extruder_stack_0.definition.getId()))
             try:
                 extruder_definition = container_registry.findDefinitionContainers(id = expected_extruder_definition_0_id)[0]
-            except IndexError as e:
+            except IndexError:
                 # It still needs to break, but we want to know what extruder ID made it break.
                 msg = "Unable to find extruder definition with the id [%s]" % expected_extruder_definition_0_id
                 Logger.logException("e", msg)

+ 4 - 5
cura/Settings/IntentManager.py

@@ -1,13 +1,12 @@
-#Copyright (c) 2019 Ultimaker B.V.
-#Cura is released under the terms of the LGPLv3 or higher.
+# Copyright (c) 2019 Ultimaker B.V.
+# Cura is released under the terms of the LGPLv3 or higher.
 
 from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal, pyqtSlot
-from typing import Any, Dict, List, Optional, Set, Tuple, TYPE_CHECKING
+from typing import Any, Dict, List, Set, Tuple, TYPE_CHECKING
 import cura.CuraApplication
 from UM.Logger import Logger
 from cura.Machines.ContainerTree import ContainerTree
 from cura.Settings.cura_empty_instance_containers import empty_intent_container
-from UM.Settings.InstanceContainer import InstanceContainer
 
 if TYPE_CHECKING:
     from UM.Settings.InstanceContainer import InstanceContainer
@@ -116,7 +115,7 @@ class IntentManager(QObject):
     ##  The intent that gets selected by default when no intent is available for
     #   the configuration, an extruder can't match the intent that the user
     #   selects, or just when creating a new printer.
-    def getDefaultIntent(self) -> InstanceContainer:
+    def getDefaultIntent(self) -> "InstanceContainer":
         return empty_intent_container
 
     @pyqtProperty(str, notify = intentCategoryChanged)

+ 0 - 1
plugins/3MFReader/__init__.py

@@ -12,7 +12,6 @@ except ImportError:
 from . import ThreeMFWorkspaceReader
 
 from UM.i18n import i18nCatalog
-from UM.Platform import Platform
 
 catalog = i18nCatalog("cura")
 

+ 0 - 1
plugins/LegacyProfileReader/tests/TestLegacyProfileReader.py

@@ -5,7 +5,6 @@ import configparser # An input for some functions we're testing.
 import os.path # To find the integration test .ini files.
 import pytest # To register tests with.
 import unittest.mock # To mock the application, plug-in and container registry out.
-import os.path
 import sys
 sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
 

Some files were not shown because too many files changed in this diff