mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-19 20:29:40 +08:00
Fix some more code-style
This commit is contained in:
parent
ae7875a756
commit
ff6bc9de4e
@ -69,6 +69,7 @@ class PickingPass(RenderPass):
|
||||
## Get the world coordinates of a picked point
|
||||
def getPickedPosition(self, x: int, y: int) -> Vector:
|
||||
distance = self.getPickedDepth(x, y)
|
||||
ray = self._scene.getActiveCamera().getRay(x, y)
|
||||
|
||||
return ray.getPointAlongRay(distance)
|
||||
camera = self._scene.getActiveCamera()
|
||||
if camera:
|
||||
return camera.getRay(x, y).getPointAlongRay(distance)
|
||||
return Vector()
|
||||
|
@ -191,6 +191,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
|
||||
def put(self, target: str, data: str, on_finished: Optional[Callable[[QNetworkReply], None]]) -> None:
|
||||
if self._manager is None:
|
||||
self._createNetworkManager()
|
||||
assert (self._manager is not None)
|
||||
request = self._createEmptyRequest(target)
|
||||
self._last_request_time = time()
|
||||
reply = self._manager.put(request, data.encode())
|
||||
@ -199,6 +200,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
|
||||
def get(self, target: str, on_finished: Optional[Callable[[QNetworkReply], None]]) -> None:
|
||||
if self._manager is None:
|
||||
self._createNetworkManager()
|
||||
assert (self._manager is not None)
|
||||
request = self._createEmptyRequest(target)
|
||||
self._last_request_time = time()
|
||||
reply = self._manager.get(request)
|
||||
@ -207,6 +209,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
|
||||
def post(self, target: str, data: str, on_finished: Optional[Callable[[QNetworkReply], None]], on_progress: Callable = None) -> None:
|
||||
if self._manager is None:
|
||||
self._createNetworkManager()
|
||||
assert (self._manager is not None)
|
||||
request = self._createEmptyRequest(target)
|
||||
self._last_request_time = time()
|
||||
reply = self._manager.post(request, data)
|
||||
@ -218,6 +221,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
|
||||
|
||||
if self._manager is None:
|
||||
self._createNetworkManager()
|
||||
assert (self._manager is not None)
|
||||
request = self._createEmptyRequest(target, content_type=None)
|
||||
multi_post_part = QHttpMultiPart(QHttpMultiPart.FormDataType)
|
||||
for part in parts:
|
||||
|
@ -208,7 +208,6 @@ class ContainerManager(QObject):
|
||||
if not file_url:
|
||||
return {"status": "error", "message": "Invalid path"}
|
||||
|
||||
mime_type = None
|
||||
if file_type not in self._container_name_filters:
|
||||
try:
|
||||
mime_type = MimeTypeDatabase.getMimeTypeForFile(file_url)
|
||||
|
@ -4,6 +4,7 @@
|
||||
from PyQt5.QtCore import Qt, QTimer
|
||||
from PyQt5.QtWidgets import QApplication
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.Math.Vector import Vector
|
||||
from UM.Tool import Tool
|
||||
from UM.Event import Event, MouseEvent
|
||||
|
Loading…
x
Reference in New Issue
Block a user