mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 01:07:52 -06:00
Remove a bunch of unused imports
This commit is contained in:
parent
c22281ad9c
commit
00078fd659
16 changed files with 15 additions and 32 deletions
|
@ -26,7 +26,6 @@ catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
import math
|
import math
|
||||||
import copy
|
|
||||||
|
|
||||||
from typing import List, Optional, TYPE_CHECKING, Any, Set, cast, Iterable, Dict
|
from typing import List, Optional, TYPE_CHECKING, Any, Set, cast, Iterable, Dict
|
||||||
|
|
||||||
|
|
|
@ -1796,7 +1796,7 @@ class CuraApplication(QtApplication):
|
||||||
try:
|
try:
|
||||||
result = workspace_reader.preRead(file_path, show_dialog=False)
|
result = workspace_reader.preRead(file_path, show_dialog=False)
|
||||||
return result == WorkspaceReader.PreReadResult.accepted
|
return result == WorkspaceReader.PreReadResult.accepted
|
||||||
except Exception as e:
|
except Exception:
|
||||||
Logger.logException("e", "Could not check file %s", file_url)
|
Logger.logException("e", "Could not check file %s", file_url)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,8 @@
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
|
|
||||||
from UM.Application import Application
|
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
from UM.Qt.ListModel import ListModel
|
from UM.Qt.ListModel import ListModel
|
||||||
from UM.Util import parseBool
|
|
||||||
|
|
||||||
from cura.Machines.VariantType import VariantType
|
|
||||||
|
|
||||||
|
|
||||||
class BuildPlateModel(ListModel):
|
class BuildPlateModel(ListModel):
|
||||||
|
@ -26,4 +21,4 @@ class BuildPlateModel(ListModel):
|
||||||
def _update(self):
|
def _update(self):
|
||||||
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
||||||
self.setItems([])
|
self.setItems([])
|
||||||
return
|
return
|
||||||
|
|
|
@ -11,7 +11,6 @@ from UM.Util import parseBool
|
||||||
from UM.OutputDevice.OutputDeviceManager import ManualDeviceAdditionAttempt
|
from UM.OutputDevice.OutputDeviceManager import ManualDeviceAdditionAttempt
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from PyQt5.QtCore import QObject
|
|
||||||
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutputDevice
|
from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutputDevice
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
# Copyright (c) 2019 Ultimaker B.V.
|
# Copyright (c) 2019 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 typing import Optional, TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||||
from UM.Settings.Interfaces import ContainerInterface
|
from UM.Settings.Interfaces import ContainerInterface
|
||||||
from UM.Signal import Signal
|
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.ContainerNode import ContainerNode
|
||||||
from cura.Machines.MaterialNode import MaterialNode
|
from cura.Machines.MaterialNode import MaterialNode
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import os
|
|
||||||
from typing import Optional, TYPE_CHECKING
|
from typing import Optional, TYPE_CHECKING
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
|
@ -14,7 +13,6 @@ from PyQt5.QtGui import QDesktopServices
|
||||||
|
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
from UM.Message import Message
|
from UM.Message import Message
|
||||||
from UM.Platform import Platform
|
|
||||||
from UM.Signal import Signal
|
from UM.Signal import Signal
|
||||||
|
|
||||||
from cura.OAuth2.LocalAuthorizationServer import LocalAuthorizationServer
|
from cura.OAuth2.LocalAuthorizationServer import LocalAuthorizationServer
|
||||||
|
|
|
@ -12,7 +12,6 @@ from UM.Scene.SceneNode import SceneNode
|
||||||
from UM.Scene.Selection import Selection
|
from UM.Scene.Selection import Selection
|
||||||
from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator
|
from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator
|
||||||
from UM.Settings.ContainerRegistry import ContainerRegistry # Finding containers by ID.
|
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
|
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()))
|
printer = global_stack.getId(), expected = expected_extruder_definition_0_id, got = extruder_stack_0.definition.getId()))
|
||||||
try:
|
try:
|
||||||
extruder_definition = container_registry.findDefinitionContainers(id = expected_extruder_definition_0_id)[0]
|
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.
|
# 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
|
msg = "Unable to find extruder definition with the id [%s]" % expected_extruder_definition_0_id
|
||||||
Logger.logException("e", msg)
|
Logger.logException("e", msg)
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
#Copyright (c) 2019 Ultimaker B.V.
|
# Copyright (c) 2019 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 PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal, pyqtSlot
|
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
|
import cura.CuraApplication
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
from cura.Machines.ContainerTree import ContainerTree
|
from cura.Machines.ContainerTree import ContainerTree
|
||||||
from cura.Settings.cura_empty_instance_containers import empty_intent_container
|
from cura.Settings.cura_empty_instance_containers import empty_intent_container
|
||||||
from UM.Settings.InstanceContainer import InstanceContainer
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from UM.Settings.InstanceContainer import InstanceContainer
|
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 intent that gets selected by default when no intent is available for
|
||||||
# the configuration, an extruder can't match the intent that the user
|
# the configuration, an extruder can't match the intent that the user
|
||||||
# selects, or just when creating a new printer.
|
# selects, or just when creating a new printer.
|
||||||
def getDefaultIntent(self) -> InstanceContainer:
|
def getDefaultIntent(self) -> "InstanceContainer":
|
||||||
return empty_intent_container
|
return empty_intent_container
|
||||||
|
|
||||||
@pyqtProperty(str, notify = intentCategoryChanged)
|
@pyqtProperty(str, notify = intentCategoryChanged)
|
||||||
|
|
|
@ -12,7 +12,6 @@ except ImportError:
|
||||||
from . import ThreeMFWorkspaceReader
|
from . import ThreeMFWorkspaceReader
|
||||||
|
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
from UM.Platform import Platform
|
|
||||||
|
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
|
|
|
@ -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 os.path # To find the integration test .ini files.
|
||||||
import pytest # To register tests with.
|
import pytest # To register tests with.
|
||||||
import unittest.mock # To mock the application, plug-in and container registry out.
|
import unittest.mock # To mock the application, plug-in and container registry out.
|
||||||
import os.path
|
|
||||||
import sys
|
import sys
|
||||||
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
|
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Copyright (c) 2016 Ultimaker B.V.
|
# Copyright (c) 2016 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 PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal
|
from PyQt5.QtCore import pyqtProperty
|
||||||
from UM.FlameProfiler import pyqtSlot
|
from UM.FlameProfiler import pyqtSlot
|
||||||
|
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
|
@ -13,6 +13,7 @@ import UM.Settings.Models.SettingVisibilityHandler
|
||||||
from cura.Settings.ExtruderManager import ExtruderManager #To get global-inherits-stack setting values from different extruders.
|
from cura.Settings.ExtruderManager import ExtruderManager #To get global-inherits-stack setting values from different extruders.
|
||||||
from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
|
from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
|
||||||
|
|
||||||
|
|
||||||
## The per object setting visibility handler ensures that only setting
|
## The per object setting visibility handler ensures that only setting
|
||||||
# definitions that have a matching instance Container are returned as visible.
|
# definitions that have a matching instance Container are returned as visible.
|
||||||
class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHandler.SettingVisibilityHandler):
|
class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHandler.SettingVisibilityHandler):
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
from UM.Math.Color import Color
|
from UM.Math.Color import Color
|
||||||
from UM.Math.Vector import Vector
|
|
||||||
from UM.PluginRegistry import PluginRegistry
|
from UM.PluginRegistry import PluginRegistry
|
||||||
from UM.Scene.SceneNode import SceneNode
|
from UM.Scene.SceneNode import SceneNode
|
||||||
from UM.View.GL.OpenGL import OpenGL
|
from UM.View.GL.OpenGL import OpenGL
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
# Copyright (c) 2018 Ultimaker B.V.
|
# Copyright (c) 2018 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.
|
||||||
|
|
||||||
import re
|
|
||||||
from typing import Dict
|
|
||||||
from PyQt5.QtCore import Qt, pyqtProperty
|
from PyQt5.QtCore import Qt, pyqtProperty
|
||||||
from UM.Qt.ListModel import ListModel
|
from UM.Qt.ListModel import ListModel
|
||||||
|
|
||||||
|
|
||||||
## Model that holds supported configurations (for material/quality packages).
|
## Model that holds supported configurations (for material/quality packages).
|
||||||
class ConfigsModel(ListModel):
|
class ConfigsModel(ListModel):
|
||||||
def __init__(self, parent = None):
|
def __init__(self, parent = None):
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
from typing import List, Optional, Union, Dict, Any
|
from typing import List, Optional, Union, Dict, Any
|
||||||
|
|
||||||
from PyQt5.QtCore import QUrl
|
|
||||||
|
|
||||||
from cura.PrinterOutput.Models.PrinterConfigurationModel import PrinterConfigurationModel
|
from cura.PrinterOutput.Models.PrinterConfigurationModel import PrinterConfigurationModel
|
||||||
|
|
||||||
from .ClusterBuildPlate import ClusterBuildPlate
|
from .ClusterBuildPlate import ClusterBuildPlate
|
||||||
|
|
|
@ -6,7 +6,7 @@ import io #To write config files to strings as if they were files.
|
||||||
from typing import Dict, List, Optional, Tuple
|
from typing import Dict, List, Optional, Tuple
|
||||||
|
|
||||||
import UM.VersionUpgrade
|
import UM.VersionUpgrade
|
||||||
from UM.Logger import Logger
|
|
||||||
|
|
||||||
## Creates a new profile instance by parsing a serialised profile in version 1
|
## Creates a new profile instance by parsing a serialised profile in version 1
|
||||||
# of the file format.
|
# of the file format.
|
||||||
|
@ -20,6 +20,7 @@ def importFrom(serialised: str, filename: str) -> Optional["Profile"]:
|
||||||
except (configparser.Error, UM.VersionUpgrade.FormatException, UM.VersionUpgrade.InvalidVersionException):
|
except (configparser.Error, UM.VersionUpgrade.FormatException, UM.VersionUpgrade.InvalidVersionException):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
## A representation of a profile used as intermediary form for conversion from
|
## A representation of a profile used as intermediary form for conversion from
|
||||||
# one format to the other.
|
# one format to the other.
|
||||||
class Profile:
|
class Profile:
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
from unittest.mock import MagicMock, patch, PropertyMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from cura.API import CuraAPI, Account
|
from cura.API import Account
|
||||||
from cura.OAuth2.AuthorizationService import AuthorizationService
|
|
||||||
from cura.OAuth2.Models import UserProfile
|
from cura.OAuth2.Models import UserProfile
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue