mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
First round of CI codestyle fixes
This commit is contained in:
parent
1fa5628cb2
commit
e7fdd02b6f
5 changed files with 12 additions and 10 deletions
|
@ -16,16 +16,19 @@ I18N_CATALOG = i18nCatalog("cura")
|
||||||
class CloudFlowMessage(Message):
|
class CloudFlowMessage(Message):
|
||||||
|
|
||||||
def __init__(self, address: str) -> None:
|
def __init__(self, address: str) -> None:
|
||||||
|
|
||||||
|
image_path = os.path.join(
|
||||||
|
CuraApplication.getInstance().getPluginRegistry().getPluginPath("UM3NetworkPrinting") or "",
|
||||||
|
"resources", "svg", "cloud-flow-start.svg"
|
||||||
|
)
|
||||||
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
text=I18N_CATALOG.i18nc("@info:status",
|
text=I18N_CATALOG.i18nc("@info:status",
|
||||||
"Send and monitor print jobs from anywhere using your Ultimaker account."),
|
"Send and monitor print jobs from anywhere using your Ultimaker account."),
|
||||||
lifetime=0,
|
lifetime=0,
|
||||||
dismissable=True,
|
dismissable=True,
|
||||||
option_state=False,
|
option_state=False,
|
||||||
image_source=QUrl.fromLocalFile(os.path.join(
|
image_source=image_path,
|
||||||
CuraApplication.getInstance().getPluginRegistry().getPluginPath("UM3NetworkPrinting"),
|
|
||||||
"resources", "svg", "cloud-flow-start.svg"
|
|
||||||
)),
|
|
||||||
image_caption=I18N_CATALOG.i18nc("@info:status Ultimaker Cloud should not be translated.",
|
image_caption=I18N_CATALOG.i18nc("@info:status Ultimaker Cloud should not be translated.",
|
||||||
"Connect to Ultimaker Cloud"),
|
"Connect to Ultimaker Cloud"),
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import List
|
from typing import List, Optional
|
||||||
|
|
||||||
from UM.FileHandler.FileHandler import FileHandler
|
from UM.FileHandler.FileHandler import FileHandler
|
||||||
from UM.FileHandler.WriteFileJob import WriteFileJob
|
from UM.FileHandler.WriteFileJob import WriteFileJob
|
||||||
|
@ -12,7 +12,7 @@ from .MeshFormatHandler import MeshFormatHandler
|
||||||
## Job that exports the build plate to the correct file format for the target cluster.
|
## Job that exports the build plate to the correct file format for the target cluster.
|
||||||
class ExportFileJob(WriteFileJob):
|
class ExportFileJob(WriteFileJob):
|
||||||
|
|
||||||
def __init__(self, file_handler: FileHandler, nodes: List[SceneNode], firmware_version: str) -> None:
|
def __init__(self, file_handler: Optional[FileHandler], nodes: List[SceneNode], firmware_version: str) -> None:
|
||||||
|
|
||||||
self._mesh_format_handler = MeshFormatHandler(file_handler, firmware_version)
|
self._mesh_format_handler = MeshFormatHandler(file_handler, firmware_version)
|
||||||
if not self._mesh_format_handler.is_valid:
|
if not self._mesh_format_handler.is_valid:
|
||||||
|
|
|
@ -32,7 +32,7 @@ class MeshFormatHandler:
|
||||||
# \return A dict with the file format details, with the following keys:
|
# \return A dict with the file format details, with the following keys:
|
||||||
# {id: str, extension: str, description: str, mime_type: str, mode: int, hide_in_file_dialog: bool}
|
# {id: str, extension: str, description: str, mime_type: str, mode: int, hide_in_file_dialog: bool}
|
||||||
@property
|
@property
|
||||||
def preferred_format(self) -> Optional[Dict[str, Union[str, int, bool]]]:
|
def preferred_format(self) -> Dict[str, Union[str, int, bool]]:
|
||||||
return self._preferred_format
|
return self._preferred_format
|
||||||
|
|
||||||
## Gets the file writer for the given file handler and mime type.
|
## Gets the file writer for the given file handler and mime type.
|
||||||
|
|
|
@ -7,7 +7,6 @@ from PyQt5.QtCore import pyqtSlot, QUrl, pyqtSignal, pyqtProperty
|
||||||
from PyQt5.QtNetwork import QNetworkReply
|
from PyQt5.QtNetwork import QNetworkReply
|
||||||
|
|
||||||
from UM.FileHandler.FileHandler import FileHandler
|
from UM.FileHandler.FileHandler import FileHandler
|
||||||
from UM.FileHandler.WriteFileJob import WriteFileJob
|
|
||||||
from UM.Message import Message
|
from UM.Message import Message
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
from UM.Scene.SceneNode import SceneNode
|
from UM.Scene.SceneNode import SceneNode
|
||||||
|
@ -130,7 +129,7 @@ class LocalClusterOutputDevice(UltimakerNetworkedPrinterOutputDevice):
|
||||||
|
|
||||||
## Handler for when the print job was created locally.
|
## Handler for when the print job was created locally.
|
||||||
# It can now be sent over the network.
|
# It can now be sent over the network.
|
||||||
def _onPrintJobCreated(self, job: WriteFileJob) -> None:
|
def _onPrintJobCreated(self, job: ExportFileJob) -> None:
|
||||||
self._progress.show()
|
self._progress.show()
|
||||||
parts = [
|
parts = [
|
||||||
self._createFormPart("name=owner", bytes(self._getUserName(), "utf-8"), "text/plain"),
|
self._createFormPart("name=owner", bytes(self._getUserName(), "utf-8"), "text/plain"),
|
||||||
|
|
|
@ -191,7 +191,7 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice):
|
||||||
|
|
||||||
# Keep track of the new printers to show.
|
# Keep track of the new printers to show.
|
||||||
# We create a new list instead of changing the existing one to get the correct order.
|
# We create a new list instead of changing the existing one to get the correct order.
|
||||||
new_printers = []
|
new_printers = [] # type: List[PrinterOutputModel]
|
||||||
|
|
||||||
# Check which printers need to be created or updated.
|
# Check which printers need to be created or updated.
|
||||||
for index, printer_data in enumerate(remote_printers):
|
for index, printer_data in enumerate(remote_printers):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue