{"action":"created","comment":{"url":"https://api.github.com/repos/pymedusa/SickRage/pulls/comments/79295701","id":79295701,"diff_hunk":"@@ -0,0 +1,46 @@\n+# coding=utf-8\n+# Author: p0psicles\n+# URL: http://code.google.com/p/sickbeard/\n+#\n+# This file is part of SickRage.\n+#\n+# SickRage is free software: you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation, either version 3 of the License, or\n+# (at your option) any later version.\n+#\n+# SickRage is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with SickRage. If not, see <http://www.gnu.org/licenses/>.\n+\n+\n+from tornado.websocket import WebSocketHandler\n+\n+clients = []\n+\n+\n+def push_to_web_socket(msg):\n+    for client in clients:\n+        client.write_message(msg)\n+\n+\n+class WebSocketUIHandler(WebSocketHandler):\n+    def check_origin(self, origin):","path":"sickrage/ws/MedusaWebSocketHandler.py","position":32,"original_position":32,"commit_id":"4ef9d57d65fa7aac3a5e47a8a9f5984acde97f4b","original_commit_id":"4ef9d57d65fa7aac3a5e47a8a9f5984acde97f4b","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars.githubusercontent.com/u/19940114?v=3","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Method could be a function](https://www.codacy.com/app/labrys-git/sickrage/file/3949966183/issues/source?bid=3183969&fileBranchId=3275229#l32)","created_at":"2016-09-18T02:08:27Z","updated_at":"2016-09-18T02:08:27Z","html_url":"https://github.com/pymedusa/SickRage/pull/526#discussion_r79295701","pull_request_url":"https://api.github.com/repos/pymedusa/SickRage/pulls/526","_links":{"self":{"href":"https://api.github.com/repos/pymedusa/SickRage/pulls/comments/79295701"},"html":{"href":"https://github.com/pymedusa/SickRage/pull/526#discussion_r79295701"},"pull_request":{"href":"https://api.github.com/repos/pymedusa/SickRage/pulls/526"}}},"pull_request":{"url":"https://api.github.com/repos/pymedusa/SickRage/pulls/526","id":68687818,"html_url":"https://github.com/pymedusa/SickRage/pull/526","diff_url":"https://github.com/pymedusa/SickRage/pull/526.diff","patch_url":"https://github.com/pymedusa/SickRage/pull/526.patch","issue_url":"https://api.github.com/repos/pymedusa/SickRage/issues/526","number":526,"state":"open","locked":false,"title":"POC: First working implementation of websockets.","user":{"login":"p0psicles","id":1331394,"avatar_url":"https://avatars.githubusercontent.com/u/1331394?v=3","gravatar_id":"","url":"https://api.github.com/users/p0psicles","html_url":"https://github.com/p0psicles","followers_url":"https://api.github.com/users/p0psicles/followers","following_url":"https://api.github.com/users/p0psicles/following{/other_user}","gists_url":"https://api.github.com/users/p0psicles/gists{/gist_id}","starred_url":"https://api.github.com/users/p0psicles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p0psicles/subscriptions","organizations_url":"https://api.github.com/users/p0psicles/orgs","repos_url":"https://api.github.com/users/p0psicles/repos","events_url":"https://api.github.com/users/p0psicles/events{/privacy}","received_events_url":"https://api.github.com/users/p0psicles/received_events","type":"User","site_admin":false},"body":"This is a working POC, for replacing the current REST polling mechanisme we use for the Pnotifications, with Websockets. For more info please refer to FR: #495.\r\n\r\nCurrently it's just a POC and based on #432 , for discussing the actual implementation.\r\n\r\n- [ ] PR is based on the DEVELOP branch\r\n- [ ] Don't send big changes all at once. Split up big PRs into multiple smaller PRs that are easier to manage and review\r\n- [ ] Always make sure the PR has a clear description of why,how, and what your trying to fix. The same goes for improvements or new features. Also if you refering to an issue, make sure a summary is available in the PR.\r\n- [ ] Read [contribution guide](https://github.com/PyMedusa/SickRage/blob/master/.github/CONTRIBUTING.md)\r\n\r\nReplaced the Rest call used for the notification, with the websockets.","created_at":"2016-05-03T10:49:04Z","updated_at":"2016-09-18T02:08:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eda35992518d8b05765fe5072ecb08e062838f9b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pymedusa/SickRage/pulls/526/commits","review_comments_url":"https://api.github.com/repos/pymedusa/SickRage/pulls/526/comments","review_comment_url":"https://api.github.com/repos/pymedusa/SickRage/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pymedusa/SickRage/issues/526/comments","statuses_url":"https://api.github.com/repos/pymedusa/SickRage/statuses/4ef9d57d65fa7aac3a5e47a8a9f5984acde97f4b","head":{"label":"pymedusa:apiv2-websockets","ref":"apiv2-websockets","sha":"4ef9d57d65fa7aac3a5e47a8a9f5984acde97f4b","user":{"login":"pymedusa","id":16712498,"avatar_url":"https://avatars.githubusercontent.com/u/16712498?v=3","gravatar_id":"","url":"https://api.github.com/users/pymedusa","html_url":"https://github.com/pymedusa","followers_url":"https://api.github.com/users/pymedusa/followers","following_url":"https://api.github.com/users/pymedusa/following{/other_user}","gists_url":"https://api.github.com/users/pymedusa/gists{/gist_id}","starred_url":"https://api.github.com/users/pymedusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pymedusa/subscriptions","organizations_url":"https://api.github.com/users/pymedusa/orgs","repos_url":"https://api.github.com/users/pymedusa/repos","events_url":"https://api.github.com/users/pymedusa/events{/privacy}","received_events_url":"https://api.github.com/users/pymedusa/received_events","type":"Organization","site_admin":false},"repo":{"id":52334681,"name":"SickRage","full_name":"pymedusa/SickRage","owner":{"login":"pymedusa","id":16712498,"avatar_url":"https://avatars.githubusercontent.com/u/16712498?v=3","gravatar_id":"","url":"https://api.github.com/users/pymedusa","html_url":"https://github.com/pymedusa","followers_url":"https://api.github.com/users/pymedusa/followers","following_url":"https://api.github.com/users/pymedusa/following{/other_user}","gists_url":"https://api.github.com/users/pymedusa/gists{/gist_id}","starred_url":"https://api.github.com/users/pymedusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pymedusa/subscriptions","organizations_url":"https://api.github.com/users/pymedusa/orgs","repos_url":"https://api.github.com/users/pymedusa/repos","events_url":"https://api.github.com/users/pymedusa/events{/privacy}","received_events_url":"https://api.github.com/users/pymedusa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pymedusa/SickRage","description":"Now with the most wanted feature: **Manual Search**. You can choose what to download! IRC: #pymedusa","fork":false,"url":"https://api.github.com/repos/pymedusa/SickRage","forks_url":"https://api.github.com/repos/pymedusa/SickRage/forks","keys_url":"https://api.github.com/repos/pymedusa/SickRage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pymedusa/SickRage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pymedusa/SickRage/teams","hooks_url":"https://api.github.com/repos/pymedusa/SickRage/hooks","issue_events_url":"https://api.github.com/repos/pymedusa/SickRage/issues/events{/number}","events_url":"https://api.github.com/repos/pymedusa/SickRage/events","assignees_url":"https://api.github.com/repos/pymedusa/SickRage/assignees{/user}","branches_url":"https://api.github.com/repos/pymedusa/SickRage/branches{/branch}","tags_url":"https://api.github.com/repos/pymedusa/SickRage/tags","blobs_url":"https://api.github.com/repos/pymedusa/SickRage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pymedusa/SickRage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pymedusa/SickRage/git/refs{/sha}","trees_url":"https://api.github.com/repos/pymedusa/SickRage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pymedusa/SickRage/statuses/{sha}","languages_url":"https://api.github.com/repos/pymedusa/SickRage/languages","stargazers_url":"https://api.github.com/repos/pymedusa/SickRage/stargazers","contributors_url":"https://api.github.com/repos/pymedusa/SickRage/contributors","subscribers_url":"https://api.github.com/repos/pymedusa/SickRage/subscribers","subscription_url":"https://api.github.com/repos/pymedusa/SickRage/subscription","commits_url":"https://api.github.com/repos/pymedusa/SickRage/commits{/sha}","git_commits_url":"https://api.github.com/repos/pymedusa/SickRage/git/commits{/sha}","comments_url":"https://api.github.com/repos/pymedusa/SickRage/comments{/number}","issue_comment_url":"https://api.github.com/repos/pymedusa/SickRage/issues/comments{/number}","contents_url":"https://api.github.com/repos/pymedusa/SickRage/contents/{+path}","compare_url":"https://api.github.com/repos/pymedusa/SickRage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pymedusa/SickRage/merges","archive_url":"https://api.github.com/repos/pymedusa/SickRage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pymedusa/SickRage/downloads","issues_url":"https://api.github.com/repos/pymedusa/SickRage/issues{/number}","pulls_url":"https://api.github.com/repos/pymedusa/SickRage/pulls{/number}","milestones_url":"https://api.github.com/repos/pymedusa/SickRage/milestones{/number}","notifications_url":"https://api.github.com/repos/pymedusa/SickRage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pymedusa/SickRage/labels{/name}","releases_url":"https://api.github.com/repos/pymedusa/SickRage/releases{/id}","deployments_url":"https://api.github.com/repos/pymedusa/SickRage/deployments","created_at":"2016-02-23T06:02:11Z","updated_at":"2016-09-15T08:01:26Z","pushed_at":"2016-09-18T01:15:56Z","git_url":"git://github.com/pymedusa/SickRage.git","ssh_url":"git@github.com:pymedusa/SickRage.git","clone_url":"https://github.com/pymedusa/SickRage.git","svn_url":"https://github.com/pymedusa/SickRage","homepage":"","size":59109,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":66,"forks":12,"open_issues":66,"watchers":24,"default_branch":"master"}},"base":{"label":"pymedusa:develop","ref":"develop","sha":"e7f94df1bc4ec39f642426297293912a4d53ff26","user":{"login":"pymedusa","id":16712498,"avatar_url":"https://avatars.githubusercontent.com/u/16712498?v=3","gravatar_id":"","url":"https://api.github.com/users/pymedusa","html_url":"https://github.com/pymedusa","followers_url":"https://api.github.com/users/pymedusa/followers","following_url":"https://api.github.com/users/pymedusa/following{/other_user}","gists_url":"https://api.github.com/users/pymedusa/gists{/gist_id}","starred_url":"https://api.github.com/users/pymedusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pymedusa/subscriptions","organizations_url":"https://api.github.com/users/pymedusa/orgs","repos_url":"https://api.github.com/users/pymedusa/repos","events_url":"https://api.github.com/users/pymedusa/events{/privacy}","received_events_url":"https://api.github.com/users/pymedusa/received_events","type":"Organization","site_admin":false},"repo":{"id":52334681,"name":"SickRage","full_name":"pymedusa/SickRage","owner":{"login":"pymedusa","id":16712498,"avatar_url":"https://avatars.githubusercontent.com/u/16712498?v=3","gravatar_id":"","url":"https://api.github.com/users/pymedusa","html_url":"https://github.com/pymedusa","followers_url":"https://api.github.com/users/pymedusa/followers","following_url":"https://api.github.com/users/pymedusa/following{/other_user}","gists_url":"https://api.github.com/users/pymedusa/gists{/gist_id}","starred_url":"https://api.github.com/users/pymedusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pymedusa/subscriptions","organizations_url":"https://api.github.com/users/pymedusa/orgs","repos_url":"https://api.github.com/users/pymedusa/repos","events_url":"https://api.github.com/users/pymedusa/events{/privacy}","received_events_url":"https://api.github.com/users/pymedusa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pymedusa/SickRage","description":"Now with the most wanted feature: **Manual Search**. You can choose what to download! IRC: #pymedusa","fork":false,"url":"https://api.github.com/repos/pymedusa/SickRage","forks_url":"https://api.github.com/repos/pymedusa/SickRage/forks","keys_url":"https://api.github.com/repos/pymedusa/SickRage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pymedusa/SickRage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pymedusa/SickRage/teams","hooks_url":"https://api.github.com/repos/pymedusa/SickRage/hooks","issue_events_url":"https://api.github.com/repos/pymedusa/SickRage/issues/events{/number}","events_url":"https://api.github.com/repos/pymedusa/SickRage/events","assignees_url":"https://api.github.com/repos/pymedusa/SickRage/assignees{/user}","branches_url":"https://api.github.com/repos/pymedusa/SickRage/branches{/branch}","tags_url":"https://api.github.com/repos/pymedusa/SickRage/tags","blobs_url":"https://api.github.com/repos/pymedusa/SickRage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pymedusa/SickRage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pymedusa/SickRage/git/refs{/sha}","trees_url":"https://api.github.com/repos/pymedusa/SickRage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pymedusa/SickRage/statuses/{sha}","languages_url":"https://api.github.com/repos/pymedusa/SickRage/languages","stargazers_url":"https://api.github.com/repos/pymedusa/SickRage/stargazers","contributors_url":"https://api.github.com/repos/pymedusa/SickRage/contributors","subscribers_url":"https://api.github.com/repos/pymedusa/SickRage/subscribers","subscription_url":"https://api.github.com/repos/pymedusa/SickRage/subscription","commits_url":"https://api.github.com/repos/pymedusa/SickRage/commits{/sha}","git_commits_url":"https://api.github.com/repos/pymedusa/SickRage/git/commits{/sha}","comments_url":"https://api.github.com/repos/pymedusa/SickRage/comments{/number}","issue_comment_url":"https://api.github.com/repos/pymedusa/SickRage/issues/comments{/number}","contents_url":"https://api.github.com/repos/pymedusa/SickRage/contents/{+path}","compare_url":"https://api.github.com/repos/pymedusa/SickRage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pymedusa/SickRage/merges","archive_url":"https://api.github.com/repos/pymedusa/SickRage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pymedusa/SickRage/downloads","issues_url":"https://api.github.com/repos/pymedusa/SickRage/issues{/number}","pulls_url":"https://api.github.com/repos/pymedusa/SickRage/pulls{/number}","milestones_url":"https://api.github.com/repos/pymedusa/SickRage/milestones{/number}","notifications_url":"https://api.github.com/repos/pymedusa/SickRage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pymedusa/SickRage/labels{/name}","releases_url":"https://api.github.com/repos/pymedusa/SickRage/releases{/id}","deployments_url":"https://api.github.com/repos/pymedusa/SickRage/deployments","created_at":"2016-02-23T06:02:11Z","updated_at":"2016-09-15T08:01:26Z","pushed_at":"2016-09-18T01:15:56Z","git_url":"git://github.com/pymedusa/SickRage.git","ssh_url":"git@github.com:pymedusa/SickRage.git","clone_url":"https://github.com/pymedusa/SickRage.git","svn_url":"https://github.com/pymedusa/SickRage","homepage":"","size":59109,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":66,"forks":12,"open_issues":66,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pymedusa/SickRage/pulls/526"},"html":{"href":"https://github.com/pymedusa/SickRage/pull/526"},"issue":{"href":"https://api.github.com/repos/pymedusa/SickRage/issues/526"},"comments":{"href":"https://api.github.com/repos/pymedusa/SickRage/issues/526/comments"},"review_comments":{"href":"https://api.github.com/repos/pymedusa/SickRage/pulls/526/comments"},"review_comment":{"href":"https://api.github.com/repos/pymedusa/SickRage/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pymedusa/SickRage/pulls/526/commits"},"statuses":{"href":"https://api.github.com/repos/pymedusa/SickRage/statuses/4ef9d57d65fa7aac3a5e47a8a9f5984acde97f4b"}}}}
{"actor":{"display_login":"codacy-bot"}}