mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -06:00
Fixed missed renames of onFinished keyword
This commit is contained in:
parent
e89983b171
commit
1cb896904b
3 changed files with 13 additions and 13 deletions
|
@ -19,5 +19,5 @@ class ClusterUM3PrinterOutputController(PrinterOutputController):
|
||||||
|
|
||||||
def setJobState(self, job: "PrintJobOutputModel", state: str):
|
def setJobState(self, job: "PrintJobOutputModel", state: str):
|
||||||
data = "{\"action\": \"%s\"}" % state
|
data = "{\"action\": \"%s\"}" % state
|
||||||
self._output_device.put("print_jobs/%s/action" % job.key, data, onFinished=None)
|
self._output_device.put("print_jobs/%s/action" % job.key, data, on_finished=None)
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,7 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
|
||||||
|
|
||||||
file_name = "none.xml"
|
file_name = "none.xml"
|
||||||
|
|
||||||
self.postForm("materials", "form-data; name=\"file\";filename=\"%s\"" % file_name, xml_data.encode(), onFinished=None)
|
self.postForm("materials", "form-data; name=\"file\";filename=\"%s\"" % file_name, xml_data.encode(), on_finished=None)
|
||||||
|
|
||||||
except NotImplementedError:
|
except NotImplementedError:
|
||||||
# If the material container is not the most "generic" one it can't be serialized an will raise a
|
# If the material container is not the most "generic" one it can't be serialized an will raise a
|
||||||
|
@ -270,7 +270,7 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
|
||||||
|
|
||||||
file_name = "%s.gcode.gz" % CuraApplication.getInstance().getPrintInformation().jobName
|
file_name = "%s.gcode.gz" % CuraApplication.getInstance().getPrintInformation().jobName
|
||||||
self.postForm("print_job", "form-data; name=\"file\";filename=\"%s\"" % file_name, compressed_gcode,
|
self.postForm("print_job", "form-data; name=\"file\";filename=\"%s\"" % file_name, compressed_gcode,
|
||||||
onFinished=self._onPostPrintJobFinished)
|
on_finished=self._onPostPrintJobFinished)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -381,8 +381,8 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
|
||||||
self._checkAuthentication()
|
self._checkAuthentication()
|
||||||
|
|
||||||
# We don't need authentication for requesting info, so we can go right ahead with requesting this.
|
# We don't need authentication for requesting info, so we can go right ahead with requesting this.
|
||||||
self.get("printer", onFinished=self._onGetPrinterDataFinished)
|
self.get("printer", on_finished=self._onGetPrinterDataFinished)
|
||||||
self.get("print_job", onFinished=self._onGetPrintJobFinished)
|
self.get("print_job", on_finished=self._onGetPrintJobFinished)
|
||||||
|
|
||||||
def _resetAuthenticationRequestedMessage(self):
|
def _resetAuthenticationRequestedMessage(self):
|
||||||
if self._authentication_requested_message:
|
if self._authentication_requested_message:
|
||||||
|
@ -404,7 +404,7 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
|
||||||
def _verifyAuthentication(self):
|
def _verifyAuthentication(self):
|
||||||
Logger.log("d", "Attempting to verify authentication")
|
Logger.log("d", "Attempting to verify authentication")
|
||||||
# This will ensure that the "_onAuthenticationRequired" is triggered, which will setup the authenticator.
|
# This will ensure that the "_onAuthenticationRequired" is triggered, which will setup the authenticator.
|
||||||
self.get("auth/verify", onFinished=self._onVerifyAuthenticationCompleted)
|
self.get("auth/verify", on_finished=self._onVerifyAuthenticationCompleted)
|
||||||
|
|
||||||
def _onVerifyAuthenticationCompleted(self, reply):
|
def _onVerifyAuthenticationCompleted(self, reply):
|
||||||
status_code = reply.attribute(QNetworkRequest.HttpStatusCodeAttribute)
|
status_code = reply.attribute(QNetworkRequest.HttpStatusCodeAttribute)
|
||||||
|
@ -426,7 +426,7 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
|
||||||
|
|
||||||
def _checkAuthentication(self):
|
def _checkAuthentication(self):
|
||||||
Logger.log("d", "Checking if authentication is correct for id %s and key %s", self._authentication_id, self._getSafeAuthKey())
|
Logger.log("d", "Checking if authentication is correct for id %s and key %s", self._authentication_id, self._getSafeAuthKey())
|
||||||
self.get("auth/check/" + str(self._authentication_id), onFinished=self._onCheckAuthenticationFinished)
|
self.get("auth/check/" + str(self._authentication_id), on_finished=self._onCheckAuthenticationFinished)
|
||||||
|
|
||||||
def _onCheckAuthenticationFinished(self, reply):
|
def _onCheckAuthenticationFinished(self, reply):
|
||||||
if str(self._authentication_id) not in reply.url().toString():
|
if str(self._authentication_id) not in reply.url().toString():
|
||||||
|
@ -502,7 +502,7 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
|
||||||
self.post("auth/request",
|
self.post("auth/request",
|
||||||
json.dumps({"application": "Cura-" + CuraApplication.getInstance().getVersion(),
|
json.dumps({"application": "Cura-" + CuraApplication.getInstance().getVersion(),
|
||||||
"user": self._getUserName()}).encode(),
|
"user": self._getUserName()}).encode(),
|
||||||
onFinished=self._onRequestAuthenticationFinished)
|
on_finished=self._onRequestAuthenticationFinished)
|
||||||
|
|
||||||
self.setAuthenticationState(AuthState.AuthenticationRequested)
|
self.setAuthenticationState(AuthState.AuthenticationRequested)
|
||||||
|
|
||||||
|
|
|
@ -31,11 +31,11 @@ class LegacyUM3PrinterOutputController(PrinterOutputController):
|
||||||
|
|
||||||
def setJobState(self, job: "PrintJobOutputModel", state: str):
|
def setJobState(self, job: "PrintJobOutputModel", state: str):
|
||||||
data = "{\"target\": \"%s\"}" % state
|
data = "{\"target\": \"%s\"}" % state
|
||||||
self._output_device.put("print_job/state", data, onFinished=None)
|
self._output_device.put("print_job/state", data, on_finished=None)
|
||||||
|
|
||||||
def setTargetBedTemperature(self, printer: "PrinterOutputModel", temperature: int):
|
def setTargetBedTemperature(self, printer: "PrinterOutputModel", temperature: int):
|
||||||
data = str(temperature)
|
data = str(temperature)
|
||||||
self._output_device.put("printer/bed/temperature/target", data, onFinished=self._onPutBedTemperatureCompleted)
|
self._output_device.put("printer/bed/temperature/target", data, on_finished=self._onPutBedTemperatureCompleted)
|
||||||
|
|
||||||
def _onPutBedTemperatureCompleted(self, reply):
|
def _onPutBedTemperatureCompleted(self, reply):
|
||||||
if Version(self._preheat_printer.firmwareVersion) < Version("3.5.92"):
|
if Version(self._preheat_printer.firmwareVersion) < Version("3.5.92"):
|
||||||
|
@ -51,10 +51,10 @@ class LegacyUM3PrinterOutputController(PrinterOutputController):
|
||||||
new_y = head_pos.y + y
|
new_y = head_pos.y + y
|
||||||
new_z = head_pos.z + z
|
new_z = head_pos.z + z
|
||||||
data = "{\n\"x\":%s,\n\"y\":%s,\n\"z\":%s\n}" %(new_x, new_y, new_z)
|
data = "{\n\"x\":%s,\n\"y\":%s,\n\"z\":%s\n}" %(new_x, new_y, new_z)
|
||||||
self._output_device.put("printer/heads/0/position", data, onFinished=None)
|
self._output_device.put("printer/heads/0/position", data, on_finished=None)
|
||||||
|
|
||||||
def homeBed(self, printer):
|
def homeBed(self, printer):
|
||||||
self._output_device.put("printer/heads/0/position/z", "0", onFinished=None)
|
self._output_device.put("printer/heads/0/position/z", "0", on_finished=None)
|
||||||
|
|
||||||
def _onPreheatBedTimerFinished(self):
|
def _onPreheatBedTimerFinished(self):
|
||||||
self.setTargetBedTemperature(self._preheat_printer, 0)
|
self.setTargetBedTemperature(self._preheat_printer, 0)
|
||||||
|
@ -89,7 +89,7 @@ class LegacyUM3PrinterOutputController(PrinterOutputController):
|
||||||
printer.updateIsPreheating(True)
|
printer.updateIsPreheating(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
self._output_device.put("printer/bed/pre_heat", data, onFinished = self._onPutPreheatBedCompleted)
|
self._output_device.put("printer/bed/pre_heat", data, on_finished = self._onPutPreheatBedCompleted)
|
||||||
printer.updateIsPreheating(True)
|
printer.updateIsPreheating(True)
|
||||||
self._preheat_request_in_progress = True
|
self._preheat_request_in_progress = True
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue