mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
Added data handling for legacy printer
CL-541
This commit is contained in:
parent
61753540e4
commit
1167fa0a89
4 changed files with 104 additions and 7 deletions
|
@ -1,4 +1,6 @@
|
|||
from UM.Application import Application
|
||||
from UM.Logger import Logger
|
||||
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice
|
||||
|
||||
from PyQt5.QtNetwork import QHttpMultiPart, QHttpPart, QNetworkRequest, QNetworkAccessManager, QNetworkReply
|
||||
|
@ -30,6 +32,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
|
|||
|
||||
def _createEmptyRequest(self, target):
|
||||
url = QUrl("http://" + self._address + self._api_prefix + target)
|
||||
print(url)
|
||||
request = QNetworkRequest(url)
|
||||
request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
|
||||
request.setHeader(QNetworkRequest.UserAgentHeader, self._user_agent)
|
||||
|
@ -66,9 +69,8 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
|
|||
self._last_response_time = time()
|
||||
try:
|
||||
self._onFinishedCallbacks[reply.url().toString() + str(reply.operation())](reply)
|
||||
except Exception as e:
|
||||
print("Something went wrong with callback", e)
|
||||
pass
|
||||
except Exception:
|
||||
Logger.logException("w", "something went wrong with callback")
|
||||
|
||||
@pyqtSlot(str, result=str)
|
||||
def getProperty(self, key):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue