{"action":"created","comment":{"url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/comments/243769769","pull_request_review_id":187626697,"id":243769769,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0Mzc2OTc2OQ==","diff_hunk":"@@ -0,0 +1,43 @@\n+#!/usr/bin/env python3\n+\n+# This script greatly speeds up execution of qutebrowser commands when a\n+# qutebrowser instance already exists.  Call it in place of your system's\n+# qutebrowser executable.  It is based on the following work:\n+#\n+# scripts/open_url_in_instance.sh\n+\n+import codecs\n+import hashlib\n+import json\n+import os\n+import os.path\n+import socket\n+import subprocess\n+import sys\n+\n+version = '1.0.4'\n+protocol_version = 1\n+\n+m = hashlib.md5()\n+m.update(bytes(os.getenv('USER'), 'utf8'))\n+socket_name = 'ipc-' + m.hexdigest()\n+\n+socket_path = os.path.join(os.getenv('XDG_RUNTIME_DIR'), 'qutebrowser', socket_name)\n+\n+command = \\\n+{\n+    'args' : sys.argv[1:],\n+    'target_arg' : 'null',\n+    'version' : version,\n+    'protocol_version' : protocol_version,\n+    'cwd' : os.getcwd()\n+}\n+\n+try:\n+    s = socket.socket(socket.AF_UNIX)\n+    s.connect(socket_path)\n+    s.sendall(bytes(json.dumps(command) + '\\n', 'utf8'))\n+    s.close()\n+except Exception as e:\n+    print(e, file = sys.stderr)\n+    subprocess.run(['/usr/bin/qutebrowser', *sys.argv[1:]])","path":"scripts/faster_execution.py","position":43,"original_position":43,"commit_id":"894546a8656aa79bc1c7df2de21ae06ff6effa4f","original_commit_id":"894546a8656aa79bc1c7df2de21ae06ff6effa4f","user":{"login":"jgkamat","id":4349709,"node_id":"MDQ6VXNlcjQzNDk3MDk=","avatar_url":"https://avatars2.githubusercontent.com/u/4349709?v=4","gravatar_id":"","url":"https://api.github.com/users/jgkamat","html_url":"https://github.com/jgkamat","followers_url":"https://api.github.com/users/jgkamat/followers","following_url":"https://api.github.com/users/jgkamat/following{/other_user}","gists_url":"https://api.github.com/users/jgkamat/gists{/gist_id}","starred_url":"https://api.github.com/users/jgkamat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgkamat/subscriptions","organizations_url":"https://api.github.com/users/jgkamat/orgs","repos_url":"https://api.github.com/users/jgkamat/repos","events_url":"https://api.github.com/users/jgkamat/events{/privacy}","received_events_url":"https://api.github.com/users/jgkamat/received_events","type":"User","site_admin":false},"body":"We really shouldn't hard-code this, maybe you can use `shutil.which`","created_at":"2018-12-23T16:45:31Z","updated_at":"2018-12-23T16:47:55Z","html_url":"https://github.com/qutebrowser/qutebrowser/pull/4484#discussion_r243769769","pull_request_url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/4484","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/comments/243769769"},"html":{"href":"https://github.com/qutebrowser/qutebrowser/pull/4484#discussion_r243769769"},"pull_request":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/4484"}}},"pull_request":{"url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/4484","id":239970965,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5OTcwOTY1","html_url":"https://github.com/qutebrowser/qutebrowser/pull/4484","diff_url":"https://github.com/qutebrowser/qutebrowser/pull/4484.diff","patch_url":"https://github.com/qutebrowser/qutebrowser/pull/4484.patch","issue_url":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/4484","number":4484,"state":"open","locked":false,"title":"Deprecate That Shell Thing","user":{"login":"NoSuck","id":10365452,"node_id":"MDQ6VXNlcjEwMzY1NDUy","avatar_url":"https://avatars2.githubusercontent.com/u/10365452?v=4","gravatar_id":"","url":"https://api.github.com/users/NoSuck","html_url":"https://github.com/NoSuck","followers_url":"https://api.github.com/users/NoSuck/followers","following_url":"https://api.github.com/users/NoSuck/following{/other_user}","gists_url":"https://api.github.com/users/NoSuck/gists{/gist_id}","starred_url":"https://api.github.com/users/NoSuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoSuck/subscriptions","organizations_url":"https://api.github.com/users/NoSuck/orgs","repos_url":"https://api.github.com/users/NoSuck/repos","events_url":"https://api.github.com/users/NoSuck/events{/privacy}","received_events_url":"https://api.github.com/users/NoSuck/received_events","type":"User","site_admin":false},"body":"This is a pure Python implementation of `open_url_in_instance.sh`, based off discussion in PR #4482.  It turned out kind of nice.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/qutebrowser/qutebrowser/4484)\n<!-- Reviewable:end -->\n","created_at":"2018-12-19T20:52:10Z","updated_at":"2018-12-23T16:47:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"117af8d9a909d04431bf640f6e91549c250bfc35","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":708435425,"node_id":"MDU6TGFiZWw3MDg0MzU0MjU=","url":"https://api.github.com/repos/qutebrowser/qutebrowser/labels/status:%20needs%20review","name":"status: needs review","color":"fef2c0","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/4484/commits","review_comments_url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/4484/comments","review_comment_url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/4484/comments","statuses_url":"https://api.github.com/repos/qutebrowser/qutebrowser/statuses/894546a8656aa79bc1c7df2de21ae06ff6effa4f","head":{"label":"NoSuck:deprecate-that-shell-thing","ref":"deprecate-that-shell-thing","sha":"894546a8656aa79bc1c7df2de21ae06ff6effa4f","user":{"login":"NoSuck","id":10365452,"node_id":"MDQ6VXNlcjEwMzY1NDUy","avatar_url":"https://avatars2.githubusercontent.com/u/10365452?v=4","gravatar_id":"","url":"https://api.github.com/users/NoSuck","html_url":"https://github.com/NoSuck","followers_url":"https://api.github.com/users/NoSuck/followers","following_url":"https://api.github.com/users/NoSuck/following{/other_user}","gists_url":"https://api.github.com/users/NoSuck/gists{/gist_id}","starred_url":"https://api.github.com/users/NoSuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoSuck/subscriptions","organizations_url":"https://api.github.com/users/NoSuck/orgs","repos_url":"https://api.github.com/users/NoSuck/repos","events_url":"https://api.github.com/users/NoSuck/events{/privacy}","received_events_url":"https://api.github.com/users/NoSuck/received_events","type":"User","site_admin":false},"repo":{"id":162229284,"node_id":"MDEwOlJlcG9zaXRvcnkxNjIyMjkyODQ=","name":"qutebrowser","full_name":"NoSuck/qutebrowser","private":false,"owner":{"login":"NoSuck","id":10365452,"node_id":"MDQ6VXNlcjEwMzY1NDUy","avatar_url":"https://avatars2.githubusercontent.com/u/10365452?v=4","gravatar_id":"","url":"https://api.github.com/users/NoSuck","html_url":"https://github.com/NoSuck","followers_url":"https://api.github.com/users/NoSuck/followers","following_url":"https://api.github.com/users/NoSuck/following{/other_user}","gists_url":"https://api.github.com/users/NoSuck/gists{/gist_id}","starred_url":"https://api.github.com/users/NoSuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoSuck/subscriptions","organizations_url":"https://api.github.com/users/NoSuck/orgs","repos_url":"https://api.github.com/users/NoSuck/repos","events_url":"https://api.github.com/users/NoSuck/events{/privacy}","received_events_url":"https://api.github.com/users/NoSuck/received_events","type":"User","site_admin":false},"html_url":"https://github.com/NoSuck/qutebrowser","description":"A keyboard-driven, vim-like browser based on PyQt5.","fork":true,"url":"https://api.github.com/repos/NoSuck/qutebrowser","forks_url":"https://api.github.com/repos/NoSuck/qutebrowser/forks","keys_url":"https://api.github.com/repos/NoSuck/qutebrowser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NoSuck/qutebrowser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NoSuck/qutebrowser/teams","hooks_url":"https://api.github.com/repos/NoSuck/qutebrowser/hooks","issue_events_url":"https://api.github.com/repos/NoSuck/qutebrowser/issues/events{/number}","events_url":"https://api.github.com/repos/NoSuck/qutebrowser/events","assignees_url":"https://api.github.com/repos/NoSuck/qutebrowser/assignees{/user}","branches_url":"https://api.github.com/repos/NoSuck/qutebrowser/branches{/branch}","tags_url":"https://api.github.com/repos/NoSuck/qutebrowser/tags","blobs_url":"https://api.github.com/repos/NoSuck/qutebrowser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NoSuck/qutebrowser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NoSuck/qutebrowser/git/refs{/sha}","trees_url":"https://api.github.com/repos/NoSuck/qutebrowser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NoSuck/qutebrowser/statuses/{sha}","languages_url":"https://api.github.com/repos/NoSuck/qutebrowser/languages","stargazers_url":"https://api.github.com/repos/NoSuck/qutebrowser/stargazers","contributors_url":"https://api.github.com/repos/NoSuck/qutebrowser/contributors","subscribers_url":"https://api.github.com/repos/NoSuck/qutebrowser/subscribers","subscription_url":"https://api.github.com/repos/NoSuck/qutebrowser/subscription","commits_url":"https://api.github.com/repos/NoSuck/qutebrowser/commits{/sha}","git_commits_url":"https://api.github.com/repos/NoSuck/qutebrowser/git/commits{/sha}","comments_url":"https://api.github.com/repos/NoSuck/qutebrowser/comments{/number}","issue_comment_url":"https://api.github.com/repos/NoSuck/qutebrowser/issues/comments{/number}","contents_url":"https://api.github.com/repos/NoSuck/qutebrowser/contents/{+path}","compare_url":"https://api.github.com/repos/NoSuck/qutebrowser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NoSuck/qutebrowser/merges","archive_url":"https://api.github.com/repos/NoSuck/qutebrowser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NoSuck/qutebrowser/downloads","issues_url":"https://api.github.com/repos/NoSuck/qutebrowser/issues{/number}","pulls_url":"https://api.github.com/repos/NoSuck/qutebrowser/pulls{/number}","milestones_url":"https://api.github.com/repos/NoSuck/qutebrowser/milestones{/number}","notifications_url":"https://api.github.com/repos/NoSuck/qutebrowser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NoSuck/qutebrowser/labels{/name}","releases_url":"https://api.github.com/repos/NoSuck/qutebrowser/releases{/id}","deployments_url":"https://api.github.com/repos/NoSuck/qutebrowser/deployments","created_at":"2018-12-18T04:18:03Z","updated_at":"2018-12-20T04:23:28Z","pushed_at":"2018-12-19T20:49:01Z","git_url":"git://github.com/NoSuck/qutebrowser.git","ssh_url":"git@github.com:NoSuck/qutebrowser.git","clone_url":"https://github.com/NoSuck/qutebrowser.git","svn_url":"https://github.com/NoSuck/qutebrowser","homepage":"https://www.qutebrowser.org/","size":35559,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"qutebrowser:master","ref":"master","sha":"cbb6ae860c156f061beb4fa597db895983eab440","user":{"login":"qutebrowser","id":21955151,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxOTU1MTUx","avatar_url":"https://avatars1.githubusercontent.com/u/21955151?v=4","gravatar_id":"","url":"https://api.github.com/users/qutebrowser","html_url":"https://github.com/qutebrowser","followers_url":"https://api.github.com/users/qutebrowser/followers","following_url":"https://api.github.com/users/qutebrowser/following{/other_user}","gists_url":"https://api.github.com/users/qutebrowser/gists{/gist_id}","starred_url":"https://api.github.com/users/qutebrowser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qutebrowser/subscriptions","organizations_url":"https://api.github.com/users/qutebrowser/orgs","repos_url":"https://api.github.com/users/qutebrowser/repos","events_url":"https://api.github.com/users/qutebrowser/events{/privacy}","received_events_url":"https://api.github.com/users/qutebrowser/received_events","type":"Organization","site_admin":false},"repo":{"id":21244505,"node_id":"MDEwOlJlcG9zaXRvcnkyMTI0NDUwNQ==","name":"qutebrowser","full_name":"qutebrowser/qutebrowser","private":false,"owner":{"login":"qutebrowser","id":21955151,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxOTU1MTUx","avatar_url":"https://avatars1.githubusercontent.com/u/21955151?v=4","gravatar_id":"","url":"https://api.github.com/users/qutebrowser","html_url":"https://github.com/qutebrowser","followers_url":"https://api.github.com/users/qutebrowser/followers","following_url":"https://api.github.com/users/qutebrowser/following{/other_user}","gists_url":"https://api.github.com/users/qutebrowser/gists{/gist_id}","starred_url":"https://api.github.com/users/qutebrowser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qutebrowser/subscriptions","organizations_url":"https://api.github.com/users/qutebrowser/orgs","repos_url":"https://api.github.com/users/qutebrowser/repos","events_url":"https://api.github.com/users/qutebrowser/events{/privacy}","received_events_url":"https://api.github.com/users/qutebrowser/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/qutebrowser/qutebrowser","description":"A keyboard-driven, vim-like browser based on PyQt5.","fork":false,"url":"https://api.github.com/repos/qutebrowser/qutebrowser","forks_url":"https://api.github.com/repos/qutebrowser/qutebrowser/forks","keys_url":"https://api.github.com/repos/qutebrowser/qutebrowser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qutebrowser/qutebrowser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qutebrowser/qutebrowser/teams","hooks_url":"https://api.github.com/repos/qutebrowser/qutebrowser/hooks","issue_events_url":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/events{/number}","events_url":"https://api.github.com/repos/qutebrowser/qutebrowser/events","assignees_url":"https://api.github.com/repos/qutebrowser/qutebrowser/assignees{/user}","branches_url":"https://api.github.com/repos/qutebrowser/qutebrowser/branches{/branch}","tags_url":"https://api.github.com/repos/qutebrowser/qutebrowser/tags","blobs_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/refs{/sha}","trees_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qutebrowser/qutebrowser/statuses/{sha}","languages_url":"https://api.github.com/repos/qutebrowser/qutebrowser/languages","stargazers_url":"https://api.github.com/repos/qutebrowser/qutebrowser/stargazers","contributors_url":"https://api.github.com/repos/qutebrowser/qutebrowser/contributors","subscribers_url":"https://api.github.com/repos/qutebrowser/qutebrowser/subscribers","subscription_url":"https://api.github.com/repos/qutebrowser/qutebrowser/subscription","commits_url":"https://api.github.com/repos/qutebrowser/qutebrowser/commits{/sha}","git_commits_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/commits{/sha}","comments_url":"https://api.github.com/repos/qutebrowser/qutebrowser/comments{/number}","issue_comment_url":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/comments{/number}","contents_url":"https://api.github.com/repos/qutebrowser/qutebrowser/contents/{+path}","compare_url":"https://api.github.com/repos/qutebrowser/qutebrowser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qutebrowser/qutebrowser/merges","archive_url":"https://api.github.com/repos/qutebrowser/qutebrowser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qutebrowser/qutebrowser/downloads","issues_url":"https://api.github.com/repos/qutebrowser/qutebrowser/issues{/number}","pulls_url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls{/number}","milestones_url":"https://api.github.com/repos/qutebrowser/qutebrowser/milestones{/number}","notifications_url":"https://api.github.com/repos/qutebrowser/qutebrowser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qutebrowser/qutebrowser/labels{/name}","releases_url":"https://api.github.com/repos/qutebrowser/qutebrowser/releases{/id}","deployments_url":"https://api.github.com/repos/qutebrowser/qutebrowser/deployments","created_at":"2014-06-26T14:59:34Z","updated_at":"2018-12-23T13:04:22Z","pushed_at":"2018-12-23T10:15:33Z","git_url":"git://github.com/qutebrowser/qutebrowser.git","ssh_url":"git@github.com:qutebrowser/qutebrowser.git","clone_url":"https://github.com/qutebrowser/qutebrowser.git","svn_url":"https://github.com/qutebrowser/qutebrowser","homepage":"https://www.qutebrowser.org/","size":38116,"stargazers_count":4086,"watchers_count":4086,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":577,"mirror_url":null,"archived":false,"open_issues_count":659,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":577,"open_issues":659,"watchers":4086,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/4484"},"html":{"href":"https://github.com/qutebrowser/qutebrowser/pull/4484"},"issue":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/4484"},"comments":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/4484/comments"},"review_comments":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/4484/comments"},"review_comment":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/4484/commits"},"statuses":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/statuses/894546a8656aa79bc1c7df2de21ae06ff6effa4f"}},"author_association":"NONE"}}
{"actor":{"display_login":"jgkamat"}}