mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-23 06:09:38 +08:00
Fix some PR comments, cleanup imports
This commit is contained in:
parent
8ee39c0489
commit
2fc5061c41
@ -15,10 +15,10 @@ from cura.CuraApplication import CuraApplication
|
||||
# This was originally part of NetworkedPrinterOutputDevice but was moved out for re-use in other classes.
|
||||
class NetworkClient:
|
||||
|
||||
def __init__(self, application: CuraApplication = None):
|
||||
def __init__(self) -> None:
|
||||
|
||||
# Use the given application instance or get the singleton instance.
|
||||
self._application = application or CuraApplication.getInstance()
|
||||
self._application = CuraApplication.getInstance()
|
||||
|
||||
# Network manager instance to use for this client.
|
||||
self._manager = None # type: Optional[QNetworkAccessManager]
|
||||
@ -89,7 +89,7 @@ class NetworkClient:
|
||||
def _validateManager(self) -> None:
|
||||
if self._manager is None:
|
||||
self._createNetworkManager()
|
||||
assert (self._manager is not None)
|
||||
assert self._manager is not None
|
||||
|
||||
## Callback for when the network manager detects that authentication is required but was not given.
|
||||
@staticmethod
|
||||
|
@ -1,22 +1,18 @@
|
||||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from UM.FileHandler.FileHandler import FileHandler #For typing.
|
||||
from UM.Logger import Logger
|
||||
from UM.Scene.SceneNode import SceneNode #For typing.
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.NetworkClient import NetworkClient
|
||||
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice, ConnectionState
|
||||
|
||||
from PyQt5.QtNetwork import QHttpMultiPart, QHttpPart, QNetworkRequest, QNetworkAccessManager, QNetworkReply, QAuthenticator
|
||||
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject, QUrl, QCoreApplication
|
||||
import os
|
||||
import gzip
|
||||
from time import time
|
||||
from typing import Any, Callable, Dict, List, Optional
|
||||
from typing import Dict, List, Optional
|
||||
from enum import IntEnum
|
||||
|
||||
import os # To get the username
|
||||
import gzip
|
||||
from PyQt5.QtNetwork import QNetworkRequest, QNetworkReply
|
||||
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject, QCoreApplication
|
||||
|
||||
from UM.FileHandler.FileHandler import FileHandler
|
||||
from UM.Scene.SceneNode import SceneNode
|
||||
from cura.NetworkClient import NetworkClient
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice, ConnectionState
|
||||
|
||||
|
||||
class AuthState(IntEnum):
|
||||
|
Loading…
x
Reference in New Issue
Block a user