Remove absolute plugin imports, some fixes

This commit is contained in:
ChrisTerBeke 2019-07-29 16:11:01 +02:00
parent 7d69b1727d
commit ddd282eef3
16 changed files with 67 additions and 62 deletions

View file

@ -101,14 +101,9 @@ class CloudApiClient:
# \param cluster_id: The ID of the cluster.
# \param cluster_job_id: The ID of the print job within the cluster.
# \param action: The name of the action to execute.
def doPrintJobAction(self, cluster_id: str, cluster_job_id: str, action: str, data: Optional[Dict[str, Any]] = None) -> None:
body = b""
if data:
try:
body = json.dumps({"data": data}).encode()
except JSONDecodeError as err:
Logger.log("w", "Could not encode body: %s", err)
return
def doPrintJobAction(self, cluster_id: str, cluster_job_id: str, action: str, data: Optional[Dict[str, Any]] = None
) -> None:
body = json.dumps({"data": data}).encode() if data else b""
url = "{}/clusters/{}/print_jobs/{}/action/{}".format(self.CLUSTER_API_ROOT, cluster_id, cluster_job_id, action)
self._manager.post(self._createEmptyRequest(url), body)