{"action":"created","comment":{"url":"https://api.github.com/repos/Ultimaker/Cura/pulls/comments/244579954","pull_request_review_id":188490742,"id":244579954,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDU3OTk1NA==","diff_hunk":"@@ -181,49 +192,85 @@ def _validateManager(self) -> None:\n             self._createNetworkManager()\n         assert (self._manager is not None)\n \n-    def put(self, target: str, data: str, on_finished: Optional[Callable[[QNetworkReply], None]]) -> None:\n+    ## Sends a put request to the given path.\n+    #  url: The path after the API prefix.\n+    #  data: The data to be sent in the body\n+    #  content_type: The content type of the body data.\n+    #  on_finished: The function to call when the response is received.\n+    #  on_progress: The function to call when the progress changes. Parameters are bytes_sent / bytes_total.\n+    def put(self, url: str, data: Union[str, bytes], content_type: Optional[str] = None,\n+            on_finished: Optional[Callable[[QNetworkReply], None]] = None,\n+            on_progress: Optional[Callable[[int, int], None]] = None) -> None:\n         self._validateManager()\n-        request = self._createEmptyRequest(target)\n+\n+        request = self._createEmptyRequest(url, content_type = content_type)\n         self._last_request_time = time()\n-        if self._manager is not None:\n-            reply = self._manager.put(request, data.encode())\n-            self._registerOnFinishedCallback(reply, on_finished)\n-        else:\n-            Logger.log(\"e\", \"Could not find manager.\")\n \n-    def delete(self, target: str, on_finished: Optional[Callable[[QNetworkReply], None]]) -> None:\n+        if not self._manager:\n+            return Logger.log(\"e\", \"No network manager was created to execute the PUT call with.\")\n+\n+        body = data if isinstance(data, bytes) else data.encode()  # type: bytes\n+        reply = self._manager.put(request, body)\n+        self._registerOnFinishedCallback(reply, on_finished)\n+\n+        if on_progress is not None:\n+            reply.uploadProgress.connect(on_progress)\n+\n+    ## Sends a delete request to the given path.\n+    #  url: The path after the API prefix.\n+    #  on_finished: The function to be call when the response is received.\n+    def delete(self, url: str, on_finished: Optional[Callable[[QNetworkReply], None]]) -> None:\n         self._validateManager()\n-        request = self._createEmptyRequest(target)\n+\n+        request = self._createEmptyRequest(url)\n         self._last_request_time = time()\n-        if self._manager is not None:\n-            reply = self._manager.deleteResource(request)\n-            self._registerOnFinishedCallback(reply, on_finished)\n-        else:\n-            Logger.log(\"e\", \"Could not find manager.\")\n \n-    def get(self, target: str, on_finished: Optional[Callable[[QNetworkReply], None]]) -> None:\n+        if not self._manager:\n+            return Logger.log(\"e\", \"No network manager was created to execute the DELETE call with.\")","path":"cura/PrinterOutput/NetworkedPrinterOutputDevice.py","position":122,"original_position":122,"commit_id":"912652654b9722e268018736a1e42b9b5af7550b","original_commit_id":"912652654b9722e268018736a1e42b9b5af7550b","user":{"login":"nallath","id":3922611,"node_id":"MDQ6VXNlcjM5MjI2MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/3922611?v=4","gravatar_id":"","url":"https://api.github.com/users/nallath","html_url":"https://github.com/nallath","followers_url":"https://api.github.com/users/nallath/followers","following_url":"https://api.github.com/users/nallath/following{/other_user}","gists_url":"https://api.github.com/users/nallath/gists{/gist_id}","starred_url":"https://api.github.com/users/nallath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nallath/subscriptions","organizations_url":"https://api.github.com/users/nallath/orgs","repos_url":"https://api.github.com/users/nallath/repos","events_url":"https://api.github.com/users/nallath/events{/privacy}","received_events_url":"https://api.github.com/users/nallath/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n            Logger.log(\"e\", \"No network manager was created to execute the DELETE call with.\")\r\n            return\r\n```","created_at":"2018-12-31T12:19:14Z","updated_at":"2018-12-31T12:19:14Z","html_url":"https://github.com/Ultimaker/Cura/pull/4926#discussion_r244579954","pull_request_url":"https://api.github.com/repos/Ultimaker/Cura/pulls/4926","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Ultimaker/Cura/pulls/comments/244579954"},"html":{"href":"https://github.com/Ultimaker/Cura/pull/4926#discussion_r244579954"},"pull_request":{"href":"https://api.github.com/repos/Ultimaker/Cura/pulls/4926"}}},"pull_request":{"url":"https://api.github.com/repos/Ultimaker/Cura/pulls/4926","id":235484467,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1NDg0NDY3","html_url":"https://github.com/Ultimaker/Cura/pull/4926","diff_url":"https://github.com/Ultimaker/Cura/pull/4926.diff","patch_url":"https://github.com/Ultimaker/Cura/pull/4926.patch","issue_url":"https://api.github.com/repos/Ultimaker/Cura/issues/4926","number":4926,"state":"open","locked":false,"title":"[4.0] [WIP] STAR-322: Cloud connection","user":{"login":"DanielSchiavini","id":2369243,"node_id":"MDQ6VXNlcjIzNjkyNDM=","avatar_url":"https://avatars3.githubusercontent.com/u/2369243?v=4","gravatar_id":"","url":"https://api.github.com/users/DanielSchiavini","html_url":"https://github.com/DanielSchiavini","followers_url":"https://api.github.com/users/DanielSchiavini/followers","following_url":"https://api.github.com/users/DanielSchiavini/following{/other_user}","gists_url":"https://api.github.com/users/DanielSchiavini/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielSchiavini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielSchiavini/subscriptions","organizations_url":"https://api.github.com/users/DanielSchiavini/orgs","repos_url":"https://api.github.com/users/DanielSchiavini/repos","events_url":"https://api.github.com/users/DanielSchiavini/events{/privacy}","received_events_url":"https://api.github.com/users/DanielSchiavini/received_events","type":"User","site_admin":false},"body":"This PR add remote monitoring and printing via Cura Connect using the Ultimaker Cloud. By signing in to Cura with your Ultimaker account, and then doing the same in Cura Connect, you can remotely see your printers, print jobs and add new jobs to the queue. More functionality will be added in later releases.\r\n\r\n**Warning: This PR also contains https://github.com/Ultimaker/Cura/pull/4960 as it fixes some things we needed.** We can merge this PR after that one is merged. That PR is not the base of this one because it is not up to date with the `4.0` branch.\r\n\r\nLeft to do:\r\n\r\n* Update monitor page QML to hide some elements when cloud connected.","created_at":"2018-12-03T15:19:03Z","updated_at":"2018-12-31T12:19:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a37288dd28bc11f889f35589d3b644333e0edb03","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ianpaschal","id":1137232,"node_id":"MDQ6VXNlcjExMzcyMzI=","avatar_url":"https://avatars2.githubusercontent.com/u/1137232?v=4","gravatar_id":"","url":"https://api.github.com/users/ianpaschal","html_url":"https://github.com/ianpaschal","followers_url":"https://api.github.com/users/ianpaschal/followers","following_url":"https://api.github.com/users/ianpaschal/following{/other_user}","gists_url":"https://api.github.com/users/ianpaschal/gists{/gist_id}","starred_url":"https://api.github.com/users/ianpaschal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianpaschal/subscriptions","organizations_url":"https://api.github.com/users/ianpaschal/orgs","repos_url":"https://api.github.com/users/ianpaschal/repos","events_url":"https://api.github.com/users/ianpaschal/events{/privacy}","received_events_url":"https://api.github.com/users/ianpaschal/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Ultimaker/Cura/pulls/4926/commits","review_comments_url":"https://api.github.com/repos/Ultimaker/Cura/pulls/4926/comments","review_comment_url":"https://api.github.com/repos/Ultimaker/Cura/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ultimaker/Cura/issues/4926/comments","statuses_url":"https://api.github.com/repos/Ultimaker/Cura/statuses/912652654b9722e268018736a1e42b9b5af7550b","head":{"label":"Ultimaker:STAR-322_cloud-connection","ref":"STAR-322_cloud-connection","sha":"912652654b9722e268018736a1e42b9b5af7550b","user":{"login":"Ultimaker","id":499557,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5OTU1Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/499557?v=4","gravatar_id":"","url":"https://api.github.com/users/Ultimaker","html_url":"https://github.com/Ultimaker","followers_url":"https://api.github.com/users/Ultimaker/followers","following_url":"https://api.github.com/users/Ultimaker/following{/other_user}","gists_url":"https://api.github.com/users/Ultimaker/gists{/gist_id}","starred_url":"https://api.github.com/users/Ultimaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ultimaker/subscriptions","organizations_url":"https://api.github.com/users/Ultimaker/orgs","repos_url":"https://api.github.com/users/Ultimaker/repos","events_url":"https://api.github.com/users/Ultimaker/events{/privacy}","received_events_url":"https://api.github.com/users/Ultimaker/received_events","type":"Organization","site_admin":false},"repo":{"id":20884782,"node_id":"MDEwOlJlcG9zaXRvcnkyMDg4NDc4Mg==","name":"Cura","full_name":"Ultimaker/Cura","private":false,"owner":{"login":"Ultimaker","id":499557,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5OTU1Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/499557?v=4","gravatar_id":"","url":"https://api.github.com/users/Ultimaker","html_url":"https://github.com/Ultimaker","followers_url":"https://api.github.com/users/Ultimaker/followers","following_url":"https://api.github.com/users/Ultimaker/following{/other_user}","gists_url":"https://api.github.com/users/Ultimaker/gists{/gist_id}","starred_url":"https://api.github.com/users/Ultimaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ultimaker/subscriptions","organizations_url":"https://api.github.com/users/Ultimaker/orgs","repos_url":"https://api.github.com/users/Ultimaker/repos","events_url":"https://api.github.com/users/Ultimaker/events{/privacy}","received_events_url":"https://api.github.com/users/Ultimaker/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Ultimaker/Cura","description":"3D printer / slicing GUI built on top of the Uranium framework","fork":false,"url":"https://api.github.com/repos/Ultimaker/Cura","forks_url":"https://api.github.com/repos/Ultimaker/Cura/forks","keys_url":"https://api.github.com/repos/Ultimaker/Cura/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ultimaker/Cura/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ultimaker/Cura/teams","hooks_url":"https://api.github.com/repos/Ultimaker/Cura/hooks","issue_events_url":"https://api.github.com/repos/Ultimaker/Cura/issues/events{/number}","events_url":"https://api.github.com/repos/Ultimaker/Cura/events","assignees_url":"https://api.github.com/repos/Ultimaker/Cura/assignees{/user}","branches_url":"https://api.github.com/repos/Ultimaker/Cura/branches{/branch}","tags_url":"https://api.github.com/repos/Ultimaker/Cura/tags","blobs_url":"https://api.github.com/repos/Ultimaker/Cura/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ultimaker/Cura/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ultimaker/Cura/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ultimaker/Cura/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ultimaker/Cura/statuses/{sha}","languages_url":"https://api.github.com/repos/Ultimaker/Cura/languages","stargazers_url":"https://api.github.com/repos/Ultimaker/Cura/stargazers","contributors_url":"https://api.github.com/repos/Ultimaker/Cura/contributors","subscribers_url":"https://api.github.com/repos/Ultimaker/Cura/subscribers","subscription_url":"https://api.github.com/repos/Ultimaker/Cura/subscription","commits_url":"https://api.github.com/repos/Ultimaker/Cura/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ultimaker/Cura/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ultimaker/Cura/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ultimaker/Cura/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ultimaker/Cura/contents/{+path}","compare_url":"https://api.github.com/repos/Ultimaker/Cura/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ultimaker/Cura/merges","archive_url":"https://api.github.com/repos/Ultimaker/Cura/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ultimaker/Cura/downloads","issues_url":"https://api.github.com/repos/Ultimaker/Cura/issues{/number}","pulls_url":"https://api.github.com/repos/Ultimaker/Cura/pulls{/number}","milestones_url":"https://api.github.com/repos/Ultimaker/Cura/milestones{/number}","notifications_url":"https://api.github.com/repos/Ultimaker/Cura/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ultimaker/Cura/labels{/name}","releases_url":"https://api.github.com/repos/Ultimaker/Cura/releases{/id}","deployments_url":"https://api.github.com/repos/Ultimaker/Cura/deployments","created_at":"2014-06-16T12:55:31Z","updated_at":"2018-12-31T10:09:37Z","pushed_at":"2018-12-31T12:15:28Z","git_url":"git://github.com/Ultimaker/Cura.git","ssh_url":"git@github.com:Ultimaker/Cura.git","clone_url":"https://github.com/Ultimaker/Cura.git","svn_url":"https://github.com/Ultimaker/Cura","homepage":"","size":168580,"stargazers_count":1150,"watchers_count":1150,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":595,"mirror_url":null,"archived":false,"open_issues_count":579,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":595,"open_issues":579,"watchers":1150,"default_branch":"master"}},"base":{"label":"Ultimaker:4.0","ref":"4.0","sha":"facf1428d6aa498b93d5e7f09900c1c3e4c1809a","user":{"login":"Ultimaker","id":499557,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5OTU1Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/499557?v=4","gravatar_id":"","url":"https://api.github.com/users/Ultimaker","html_url":"https://github.com/Ultimaker","followers_url":"https://api.github.com/users/Ultimaker/followers","following_url":"https://api.github.com/users/Ultimaker/following{/other_user}","gists_url":"https://api.github.com/users/Ultimaker/gists{/gist_id}","starred_url":"https://api.github.com/users/Ultimaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ultimaker/subscriptions","organizations_url":"https://api.github.com/users/Ultimaker/orgs","repos_url":"https://api.github.com/users/Ultimaker/repos","events_url":"https://api.github.com/users/Ultimaker/events{/privacy}","received_events_url":"https://api.github.com/users/Ultimaker/received_events","type":"Organization","site_admin":false},"repo":{"id":20884782,"node_id":"MDEwOlJlcG9zaXRvcnkyMDg4NDc4Mg==","name":"Cura","full_name":"Ultimaker/Cura","private":false,"owner":{"login":"Ultimaker","id":499557,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5OTU1Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/499557?v=4","gravatar_id":"","url":"https://api.github.com/users/Ultimaker","html_url":"https://github.com/Ultimaker","followers_url":"https://api.github.com/users/Ultimaker/followers","following_url":"https://api.github.com/users/Ultimaker/following{/other_user}","gists_url":"https://api.github.com/users/Ultimaker/gists{/gist_id}","starred_url":"https://api.github.com/users/Ultimaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ultimaker/subscriptions","organizations_url":"https://api.github.com/users/Ultimaker/orgs","repos_url":"https://api.github.com/users/Ultimaker/repos","events_url":"https://api.github.com/users/Ultimaker/events{/privacy}","received_events_url":"https://api.github.com/users/Ultimaker/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Ultimaker/Cura","description":"3D printer / slicing GUI built on top of the Uranium framework","fork":false,"url":"https://api.github.com/repos/Ultimaker/Cura","forks_url":"https://api.github.com/repos/Ultimaker/Cura/forks","keys_url":"https://api.github.com/repos/Ultimaker/Cura/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ultimaker/Cura/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ultimaker/Cura/teams","hooks_url":"https://api.github.com/repos/Ultimaker/Cura/hooks","issue_events_url":"https://api.github.com/repos/Ultimaker/Cura/issues/events{/number}","events_url":"https://api.github.com/repos/Ultimaker/Cura/events","assignees_url":"https://api.github.com/repos/Ultimaker/Cura/assignees{/user}","branches_url":"https://api.github.com/repos/Ultimaker/Cura/branches{/branch}","tags_url":"https://api.github.com/repos/Ultimaker/Cura/tags","blobs_url":"https://api.github.com/repos/Ultimaker/Cura/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ultimaker/Cura/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ultimaker/Cura/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ultimaker/Cura/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ultimaker/Cura/statuses/{sha}","languages_url":"https://api.github.com/repos/Ultimaker/Cura/languages","stargazers_url":"https://api.github.com/repos/Ultimaker/Cura/stargazers","contributors_url":"https://api.github.com/repos/Ultimaker/Cura/contributors","subscribers_url":"https://api.github.com/repos/Ultimaker/Cura/subscribers","subscription_url":"https://api.github.com/repos/Ultimaker/Cura/subscription","commits_url":"https://api.github.com/repos/Ultimaker/Cura/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ultimaker/Cura/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ultimaker/Cura/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ultimaker/Cura/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ultimaker/Cura/contents/{+path}","compare_url":"https://api.github.com/repos/Ultimaker/Cura/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ultimaker/Cura/merges","archive_url":"https://api.github.com/repos/Ultimaker/Cura/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ultimaker/Cura/downloads","issues_url":"https://api.github.com/repos/Ultimaker/Cura/issues{/number}","pulls_url":"https://api.github.com/repos/Ultimaker/Cura/pulls{/number}","milestones_url":"https://api.github.com/repos/Ultimaker/Cura/milestones{/number}","notifications_url":"https://api.github.com/repos/Ultimaker/Cura/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ultimaker/Cura/labels{/name}","releases_url":"https://api.github.com/repos/Ultimaker/Cura/releases{/id}","deployments_url":"https://api.github.com/repos/Ultimaker/Cura/deployments","created_at":"2014-06-16T12:55:31Z","updated_at":"2018-12-31T10:09:37Z","pushed_at":"2018-12-31T12:15:28Z","git_url":"git://github.com/Ultimaker/Cura.git","ssh_url":"git@github.com:Ultimaker/Cura.git","clone_url":"https://github.com/Ultimaker/Cura.git","svn_url":"https://github.com/Ultimaker/Cura","homepage":"","size":168580,"stargazers_count":1150,"watchers_count":1150,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":595,"mirror_url":null,"archived":false,"open_issues_count":579,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":595,"open_issues":579,"watchers":1150,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ultimaker/Cura/pulls/4926"},"html":{"href":"https://github.com/Ultimaker/Cura/pull/4926"},"issue":{"href":"https://api.github.com/repos/Ultimaker/Cura/issues/4926"},"comments":{"href":"https://api.github.com/repos/Ultimaker/Cura/issues/4926/comments"},"review_comments":{"href":"https://api.github.com/repos/Ultimaker/Cura/pulls/4926/comments"},"review_comment":{"href":"https://api.github.com/repos/Ultimaker/Cura/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ultimaker/Cura/pulls/4926/commits"},"statuses":{"href":"https://api.github.com/repos/Ultimaker/Cura/statuses/912652654b9722e268018736a1e42b9b5af7550b"}},"author_association":"NONE"}}
{"actor":{"display_login":"nallath"}}