{"action":"created","comment":{"url":"https://api.github.com/repos/scVENUS/PeekabooAV/pulls/comments/218451732","pull_request_review_id":156391598,"id":218451732,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODQ1MTczMg==","diff_hunk":"@@ -37,16 +37,40 @@\n def guess_mime_type_from_file_contents(file_path):\n     \"\"\"  Get type from file magic bytes. \"\"\"\n     mt = magic.from_file(file_path, mime=True)\n-    if mt:\n-        return mt\n+    if not mt:\n+        return None\n+\n+    return mt\n+\n+\n+def register_additional_mime_types():\n+    # do not re-register if already done, take the module's inited flag as\n+    # indicator\n+    if mimetypes.inited:\n+        return\n+\n+    # will init the module and set inited flag on first call\n+    mimetypes.add_type('application/javascript', '.jse')","path":"peekaboo/toolbox/files.py","position":19,"original_position":19,"commit_id":"d7233d3297a4a7b6cbf71ea3f6d098660ff18c67","original_commit_id":"d7233d3297a4a7b6cbf71ea3f6d098660ff18c67","user":{"login":"Jack28","id":2771054,"node_id":"MDQ6VXNlcjI3NzEwNTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2771054?v=4","gravatar_id":"","url":"https://api.github.com/users/Jack28","html_url":"https://github.com/Jack28","followers_url":"https://api.github.com/users/Jack28/followers","following_url":"https://api.github.com/users/Jack28/following{/other_user}","gists_url":"https://api.github.com/users/Jack28/gists{/gist_id}","starred_url":"https://api.github.com/users/Jack28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jack28/subscriptions","organizations_url":"https://api.github.com/users/Jack28/orgs","repos_url":"https://api.github.com/users/Jack28/repos","events_url":"https://api.github.com/users/Jack28/events{/privacy}","received_events_url":"https://api.github.com/users/Jack28/received_events","type":"User","site_admin":false},"body":"Wouldn't submission with profile 'generic' produce that exact behaviour?\r\n`cmd start`","created_at":"2018-09-18T14:18:10Z","updated_at":"2018-09-18T14:18:10Z","html_url":"https://github.com/scVENUS/PeekabooAV/pull/29#discussion_r218451732","pull_request_url":"https://api.github.com/repos/scVENUS/PeekabooAV/pulls/29","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/scVENUS/PeekabooAV/pulls/comments/218451732"},"html":{"href":"https://github.com/scVENUS/PeekabooAV/pull/29#discussion_r218451732"},"pull_request":{"href":"https://api.github.com/repos/scVENUS/PeekabooAV/pulls/29"}},"in_reply_to_id":215763863},"pull_request":{"url":"https://api.github.com/repos/scVENUS/PeekabooAV/pulls/29","id":212417220,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyNDE3MjIw","html_url":"https://github.com/scVENUS/PeekabooAV/pull/29","diff_url":"https://github.com/scVENUS/PeekabooAV/pull/29.diff","patch_url":"https://github.com/scVENUS/PeekabooAV/pull/29.patch","issue_url":"https://api.github.com/repos/scVENUS/PeekabooAV/issues/29","number":29,"state":"open","locked":false,"title":"RFC: Guess file extensions and various cleanup around it","user":{"login":"michaelweiser","id":1473703,"node_id":"MDQ6VXNlcjE0NzM3MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/1473703?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelweiser","html_url":"https://github.com/michaelweiser","followers_url":"https://api.github.com/users/michaelweiser/followers","following_url":"https://api.github.com/users/michaelweiser/following{/other_user}","gists_url":"https://api.github.com/users/michaelweiser/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelweiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelweiser/subscriptions","organizations_url":"https://api.github.com/users/michaelweiser/orgs","repos_url":"https://api.github.com/users/michaelweiser/repos","events_url":"https://api.github.com/users/michaelweiser/events{/privacy}","received_events_url":"https://api.github.com/users/michaelweiser/received_events","type":"User","site_admin":false},"body":"Hi, I took a crack at guessing file extensions from mime types.\r\n\r\nThis lead to various cleanup in preparation to it, e.g. avoiding a trailing dot if we have no extension and only creating the workdir and symlink if we do have one to work with.\r\n\r\nThe guesswork itself is somewhat overenthusiastic in that it returns e.g. .ksh for text/plain. Otherwise it works fine, coming back with e.g. .py for text/x-python.\r\n\r\nSo I put this up for testing and comments for the time being.","created_at":"2018-08-31T15:21:17Z","updated_at":"2018-09-18T14:18:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2970ba486a0954597f68cd8516663b007bf5c1b2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":608690639,"node_id":"MDU6TGFiZWw2MDg2OTA2Mzk=","url":"https://api.github.com/repos/scVENUS/PeekabooAV/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":{"url":"https://api.github.com/repos/scVENUS/PeekabooAV/milestones/1","html_url":"https://github.com/scVENUS/PeekabooAV/milestone/1","labels_url":"https://api.github.com/repos/scVENUS/PeekabooAV/milestones/1/labels","id":3627470,"node_id":"MDk6TWlsZXN0b25lMzYyNzQ3MA==","number":1,"title":"1.7","description":"","creator":{"login":"michaelweiser","id":1473703,"node_id":"MDQ6VXNlcjE0NzM3MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/1473703?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelweiser","html_url":"https://github.com/michaelweiser","followers_url":"https://api.github.com/users/michaelweiser/followers","following_url":"https://api.github.com/users/michaelweiser/following{/other_user}","gists_url":"https://api.github.com/users/michaelweiser/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelweiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelweiser/subscriptions","organizations_url":"https://api.github.com/users/michaelweiser/orgs","repos_url":"https://api.github.com/users/michaelweiser/repos","events_url":"https://api.github.com/users/michaelweiser/events{/privacy}","received_events_url":"https://api.github.com/users/michaelweiser/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":1,"state":"open","created_at":"2018-09-06T07:05:47Z","updated_at":"2018-09-17T15:08:42Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/scVENUS/PeekabooAV/pulls/29/commits","review_comments_url":"https://api.github.com/repos/scVENUS/PeekabooAV/pulls/29/comments","review_comment_url":"https://api.github.com/repos/scVENUS/PeekabooAV/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scVENUS/PeekabooAV/issues/29/comments","statuses_url":"https://api.github.com/repos/scVENUS/PeekabooAV/statuses/d7233d3297a4a7b6cbf71ea3f6d098660ff18c67","head":{"label":"michaelweiser:guess-fileext","ref":"guess-fileext","sha":"d7233d3297a4a7b6cbf71ea3f6d098660ff18c67","user":{"login":"michaelweiser","id":1473703,"node_id":"MDQ6VXNlcjE0NzM3MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/1473703?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelweiser","html_url":"https://github.com/michaelweiser","followers_url":"https://api.github.com/users/michaelweiser/followers","following_url":"https://api.github.com/users/michaelweiser/following{/other_user}","gists_url":"https://api.github.com/users/michaelweiser/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelweiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelweiser/subscriptions","organizations_url":"https://api.github.com/users/michaelweiser/orgs","repos_url":"https://api.github.com/users/michaelweiser/repos","events_url":"https://api.github.com/users/michaelweiser/events{/privacy}","received_events_url":"https://api.github.com/users/michaelweiser/received_events","type":"User","site_admin":false},"repo":{"id":145852625,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4NTI2MjU=","name":"PeekabooAV","full_name":"michaelweiser/PeekabooAV","private":false,"owner":{"login":"michaelweiser","id":1473703,"node_id":"MDQ6VXNlcjE0NzM3MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/1473703?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelweiser","html_url":"https://github.com/michaelweiser","followers_url":"https://api.github.com/users/michaelweiser/followers","following_url":"https://api.github.com/users/michaelweiser/following{/other_user}","gists_url":"https://api.github.com/users/michaelweiser/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelweiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelweiser/subscriptions","organizations_url":"https://api.github.com/users/michaelweiser/orgs","repos_url":"https://api.github.com/users/michaelweiser/repos","events_url":"https://api.github.com/users/michaelweiser/events{/privacy}","received_events_url":"https://api.github.com/users/michaelweiser/received_events","type":"User","site_admin":false},"html_url":"https://github.com/michaelweiser/PeekabooAV","description":"Peekaboo Extended Email Attachment Behavior Observation Owl","fork":true,"url":"https://api.github.com/repos/michaelweiser/PeekabooAV","forks_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/forks","keys_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/teams","hooks_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/hooks","issue_events_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/issues/events{/number}","events_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/events","assignees_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/assignees{/user}","branches_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/branches{/branch}","tags_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/tags","blobs_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/git/refs{/sha}","trees_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/statuses/{sha}","languages_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/languages","stargazers_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/stargazers","contributors_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/contributors","subscribers_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/subscribers","subscription_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/subscription","commits_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/commits{/sha}","git_commits_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/git/commits{/sha}","comments_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/comments{/number}","issue_comment_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/issues/comments{/number}","contents_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/contents/{+path}","compare_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/merges","archive_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/downloads","issues_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/issues{/number}","pulls_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/pulls{/number}","milestones_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/milestones{/number}","notifications_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/labels{/name}","releases_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/releases{/id}","deployments_url":"https://api.github.com/repos/michaelweiser/PeekabooAV/deployments","created_at":"2018-08-23T12:48:18Z","updated_at":"2018-08-31T07:06:27Z","pushed_at":"2018-09-07T12:07:52Z","git_url":"git://github.com/michaelweiser/PeekabooAV.git","ssh_url":"git@github.com:michaelweiser/PeekabooAV.git","clone_url":"https://github.com/michaelweiser/PeekabooAV.git","svn_url":"https://github.com/michaelweiser/PeekabooAV","homepage":"","size":372,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"scVENUS:master","ref":"master","sha":"27e011aa35981d4e9c4893e01b23c9e2a400156d","user":{"login":"scVENUS","id":28803945,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4ODAzOTQ1","avatar_url":"https://avatars0.githubusercontent.com/u/28803945?v=4","gravatar_id":"","url":"https://api.github.com/users/scVENUS","html_url":"https://github.com/scVENUS","followers_url":"https://api.github.com/users/scVENUS/followers","following_url":"https://api.github.com/users/scVENUS/following{/other_user}","gists_url":"https://api.github.com/users/scVENUS/gists{/gist_id}","starred_url":"https://api.github.com/users/scVENUS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scVENUS/subscriptions","organizations_url":"https://api.github.com/users/scVENUS/orgs","repos_url":"https://api.github.com/users/scVENUS/repos","events_url":"https://api.github.com/users/scVENUS/events{/privacy}","received_events_url":"https://api.github.com/users/scVENUS/received_events","type":"Organization","site_admin":false},"repo":{"id":91793659,"node_id":"MDEwOlJlcG9zaXRvcnk5MTc5MzY1OQ==","name":"PeekabooAV","full_name":"scVENUS/PeekabooAV","private":false,"owner":{"login":"scVENUS","id":28803945,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4ODAzOTQ1","avatar_url":"https://avatars0.githubusercontent.com/u/28803945?v=4","gravatar_id":"","url":"https://api.github.com/users/scVENUS","html_url":"https://github.com/scVENUS","followers_url":"https://api.github.com/users/scVENUS/followers","following_url":"https://api.github.com/users/scVENUS/following{/other_user}","gists_url":"https://api.github.com/users/scVENUS/gists{/gist_id}","starred_url":"https://api.github.com/users/scVENUS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scVENUS/subscriptions","organizations_url":"https://api.github.com/users/scVENUS/orgs","repos_url":"https://api.github.com/users/scVENUS/repos","events_url":"https://api.github.com/users/scVENUS/events{/privacy}","received_events_url":"https://api.github.com/users/scVENUS/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/scVENUS/PeekabooAV","description":"Peekaboo Extended Email Attachment Behavior Observation Owl","fork":false,"url":"https://api.github.com/repos/scVENUS/PeekabooAV","forks_url":"https://api.github.com/repos/scVENUS/PeekabooAV/forks","keys_url":"https://api.github.com/repos/scVENUS/PeekabooAV/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scVENUS/PeekabooAV/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scVENUS/PeekabooAV/teams","hooks_url":"https://api.github.com/repos/scVENUS/PeekabooAV/hooks","issue_events_url":"https://api.github.com/repos/scVENUS/PeekabooAV/issues/events{/number}","events_url":"https://api.github.com/repos/scVENUS/PeekabooAV/events","assignees_url":"https://api.github.com/repos/scVENUS/PeekabooAV/assignees{/user}","branches_url":"https://api.github.com/repos/scVENUS/PeekabooAV/branches{/branch}","tags_url":"https://api.github.com/repos/scVENUS/PeekabooAV/tags","blobs_url":"https://api.github.com/repos/scVENUS/PeekabooAV/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scVENUS/PeekabooAV/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scVENUS/PeekabooAV/git/refs{/sha}","trees_url":"https://api.github.com/repos/scVENUS/PeekabooAV/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scVENUS/PeekabooAV/statuses/{sha}","languages_url":"https://api.github.com/repos/scVENUS/PeekabooAV/languages","stargazers_url":"https://api.github.com/repos/scVENUS/PeekabooAV/stargazers","contributors_url":"https://api.github.com/repos/scVENUS/PeekabooAV/contributors","subscribers_url":"https://api.github.com/repos/scVENUS/PeekabooAV/subscribers","subscription_url":"https://api.github.com/repos/scVENUS/PeekabooAV/subscription","commits_url":"https://api.github.com/repos/scVENUS/PeekabooAV/commits{/sha}","git_commits_url":"https://api.github.com/repos/scVENUS/PeekabooAV/git/commits{/sha}","comments_url":"https://api.github.com/repos/scVENUS/PeekabooAV/comments{/number}","issue_comment_url":"https://api.github.com/repos/scVENUS/PeekabooAV/issues/comments{/number}","contents_url":"https://api.github.com/repos/scVENUS/PeekabooAV/contents/{+path}","compare_url":"https://api.github.com/repos/scVENUS/PeekabooAV/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scVENUS/PeekabooAV/merges","archive_url":"https://api.github.com/repos/scVENUS/PeekabooAV/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scVENUS/PeekabooAV/downloads","issues_url":"https://api.github.com/repos/scVENUS/PeekabooAV/issues{/number}","pulls_url":"https://api.github.com/repos/scVENUS/PeekabooAV/pulls{/number}","milestones_url":"https://api.github.com/repos/scVENUS/PeekabooAV/milestones{/number}","notifications_url":"https://api.github.com/repos/scVENUS/PeekabooAV/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scVENUS/PeekabooAV/labels{/name}","releases_url":"https://api.github.com/repos/scVENUS/PeekabooAV/releases{/id}","deployments_url":"https://api.github.com/repos/scVENUS/PeekabooAV/deployments","created_at":"2017-05-19T10:10:38Z","updated_at":"2018-09-17T15:08:44Z","pushed_at":"2018-09-17T15:08:43Z","git_url":"git://github.com/scVENUS/PeekabooAV.git","ssh_url":"git@github.com:scVENUS/PeekabooAV.git","clone_url":"https://github.com/scVENUS/PeekabooAV.git","svn_url":"https://github.com/scVENUS/PeekabooAV","homepage":"","size":347,"stargazers_count":17,"watchers_count":17,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":9,"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":6,"open_issues":9,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scVENUS/PeekabooAV/pulls/29"},"html":{"href":"https://github.com/scVENUS/PeekabooAV/pull/29"},"issue":{"href":"https://api.github.com/repos/scVENUS/PeekabooAV/issues/29"},"comments":{"href":"https://api.github.com/repos/scVENUS/PeekabooAV/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/scVENUS/PeekabooAV/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/scVENUS/PeekabooAV/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scVENUS/PeekabooAV/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/scVENUS/PeekabooAV/statuses/d7233d3297a4a7b6cbf71ea3f6d098660ff18c67"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Jack28"}}