mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
Rename the _live_multiparts
to the even better _kept_alive_multiparts
name
CL-541
This commit is contained in:
parent
fc3a47cb7b
commit
695c7d8267
1 changed files with 4 additions and 4 deletions
|
@ -47,7 +47,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
|
||||||
|
|
||||||
# QHttpMultiPart objects need to be kept alive and not garbage collected during the
|
# QHttpMultiPart objects need to be kept alive and not garbage collected during the
|
||||||
# HTTP which uses them. We hold references to these QHttpMultiPart objects here.
|
# HTTP which uses them. We hold references to these QHttpMultiPart objects here.
|
||||||
self._live_multiparts = {} # type: Dict[QNetworkReply, QHttpMultiPart]
|
self._kept_alive_multiparts = {} # type: Dict[QNetworkReply, QHttpMultiPart]
|
||||||
|
|
||||||
self._sending_gcode = False
|
self._sending_gcode = False
|
||||||
self._compressing_gcode = False
|
self._compressing_gcode = False
|
||||||
|
@ -172,8 +172,8 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
|
||||||
return "Unknown User" # Couldn't find out username.
|
return "Unknown User" # Couldn't find out username.
|
||||||
|
|
||||||
def _clearCachedMultiPart(self, reply: QNetworkReply) -> None:
|
def _clearCachedMultiPart(self, reply: QNetworkReply) -> None:
|
||||||
if reply in self._live_multiparts:
|
if reply in self._kept_alive_multiparts:
|
||||||
del self._live_multiparts[reply]
|
del self._kept_alive_multiparts[reply]
|
||||||
|
|
||||||
def put(self, target: str, data: str, onFinished: Optional[Callable[[Any, QNetworkReply], None]]) -> None:
|
def put(self, target: str, data: str, onFinished: Optional[Callable[[Any, QNetworkReply], None]]) -> None:
|
||||||
if self._manager is None:
|
if self._manager is None:
|
||||||
|
@ -221,7 +221,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
|
||||||
|
|
||||||
reply = self._manager.post(request, multi_post_part)
|
reply = self._manager.post(request, multi_post_part)
|
||||||
|
|
||||||
self._live_multiparts[reply] = multi_post_part
|
self._kept_alive_multiparts[reply] = multi_post_part
|
||||||
|
|
||||||
if onProgress is not None:
|
if onProgress is not None:
|
||||||
reply.uploadProgress.connect(onProgress)
|
reply.uploadProgress.connect(onProgress)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue