mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 08:47:50 -06:00
Remove absolute plugin imports, some fixes
This commit is contained in:
parent
7d69b1727d
commit
ddd282eef3
16 changed files with 67 additions and 62 deletions
|
@ -3,6 +3,10 @@ from datetime import datetime, timezone
|
|||
from typing import TypeVar, Dict, List, Any, Type, Union
|
||||
|
||||
|
||||
# Type variable used in the parse methods below, which should be a subclass of BaseModel.
|
||||
T = TypeVar("T", bound="BaseModel")
|
||||
|
||||
|
||||
class BaseModel:
|
||||
|
||||
def __init__(self, **kwargs) -> None:
|
||||
|
@ -29,9 +33,6 @@ class BaseModel:
|
|||
def toDict(self) -> Dict[str, Any]:
|
||||
return self.__dict__
|
||||
|
||||
# Type variable used in the parse methods below, which should be a subclass of BaseModel.
|
||||
T = TypeVar("T", bound="BaseModel")
|
||||
|
||||
## Parses a single model.
|
||||
# \param model_class: The model class.
|
||||
# \param values: The value of the model, which is usually a dictionary, but may also be already parsed.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
## Class representing a material that was fetched from the cluster API.
|
||||
from plugins.UM3NetworkPrinting.src.Models.BaseModel import BaseModel
|
||||
from .BaseModel import BaseModel
|
||||
|
||||
|
||||
class ClusterMaterial(BaseModel):
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import pyqtProperty, QObject
|
||||
|
||||
|
||||
BLOCKING_CHANGE_TYPES = [
|
||||
"material_insert", "buildplate_change"
|
||||
]
|
||||
|
@ -11,8 +11,7 @@ BLOCKING_CHANGE_TYPES = [
|
|||
class ConfigurationChangeModel(QObject):
|
||||
def __init__(self, type_of_change: str, index: int, target_name: str, origin_name: str) -> None:
|
||||
super().__init__()
|
||||
self._type_of_change = type_of_change
|
||||
# enum = ["material", "print_core_change"]
|
||||
self._type_of_change = type_of_change # enum = ["material", "print_core_change"]
|
||||
self._can_override = self._type_of_change not in BLOCKING_CHANGE_TYPES
|
||||
self._index = index
|
||||
self._target_name = target_name
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
## Class representing a local material that was fetched from the container registry.
|
||||
from plugins.UM3NetworkPrinting.src.Models.BaseModel import BaseModel
|
||||
from .BaseModel import BaseModel
|
||||
|
||||
|
||||
class LocalMaterial(BaseModel):
|
||||
|
|
|
@ -6,13 +6,14 @@ from PyQt5.QtCore import pyqtProperty, pyqtSignal
|
|||
|
||||
from cura.PrinterOutput.Models.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
||||
from plugins.UM3NetworkPrinting.src.Models.ConfigurationChangeModel import ConfigurationChangeModel
|
||||
|
||||
from .ConfigurationChangeModel import ConfigurationChangeModel
|
||||
|
||||
|
||||
class UM3PrintJobOutputModel(PrintJobOutputModel):
|
||||
configurationChangesChanged = pyqtSignal()
|
||||
|
||||
def __init__(self, output_controller: "PrinterOutputController", key: str = "", name: str = "", parent=None) -> None:
|
||||
def __init__(self, output_controller: PrinterOutputController, key: str = "", name: str = "", parent=None) -> None:
|
||||
super().__init__(output_controller, key, name, parent)
|
||||
self._configuration_changes = [] # type: List[ConfigurationChangeModel]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue