{"action":"created","comment":{"url":"https://api.github.com/repos/hoover/snoop/pulls/comments/77914908","id":77914908,"diff_hunk":"@@ -0,0 +1,84 @@\n+from django.core.management.base import BaseCommand\n+from pathlib import Path\n+import base64\n+from ... import models\n+from ... import emails\n+from ... import pgp\n+from ...content_types import guess_content_type\n+\n+class Command(BaseCommand):\n+    help = \"Export digested pgp .eml files to a zip archive\"\n+\n+    def add_arguments(self, parser):\n+        parser.add_argument('where',\n+                            help='SQL `where` clause to be ran ' +\n+                                 'on the snoop_document table')\n+        parser.add_argument('destination',\n+                            help='path to the folder where ' +\n+                                 'the files will be dumped')\n+\n+\n+    def handle(self, where, destination, **options):\n+        query = (","path":"snoop/management/commands/export-pgp.py","position":22,"original_position":22,"commit_id":"22d0bbe8c5ca1ffce64ed89754d3cd5c7a4d5811","original_commit_id":"22d0bbe8c5ca1ffce64ed89754d3cd5c7a4d5811","user":{"login":"mgax","id":27617,"avatar_url":"https://avatars.githubusercontent.com/u/27617?v=3","gravatar_id":"","url":"https://api.github.com/users/mgax","html_url":"https://github.com/mgax","followers_url":"https://api.github.com/users/mgax/followers","following_url":"https://api.github.com/users/mgax/following{/other_user}","gists_url":"https://api.github.com/users/mgax/gists{/gist_id}","starred_url":"https://api.github.com/users/mgax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgax/subscriptions","organizations_url":"https://api.github.com/users/mgax/orgs","repos_url":"https://api.github.com/users/mgax/repos","events_url":"https://api.github.com/users/mgax/events{/privacy}","received_events_url":"https://api.github.com/users/mgax/received_events","type":"User","site_admin":false},"body":"How about we extract this logic to `snoop/utils.py`?","created_at":"2016-09-07T22:18:17Z","updated_at":"2016-09-07T22:18:17Z","html_url":"https://github.com/hoover/snoop/pull/13#discussion_r77914908","pull_request_url":"https://api.github.com/repos/hoover/snoop/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/hoover/snoop/pulls/comments/77914908"},"html":{"href":"https://github.com/hoover/snoop/pull/13#discussion_r77914908"},"pull_request":{"href":"https://api.github.com/repos/hoover/snoop/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/hoover/snoop/pulls/13","id":84378004,"html_url":"https://github.com/hoover/snoop/pull/13","diff_url":"https://github.com/hoover/snoop/pull/13.diff","patch_url":"https://github.com/hoover/snoop/pull/13.patch","issue_url":"https://api.github.com/repos/hoover/snoop/issues/13","number":13,"state":"open","locked":false,"title":"command for dumping pgp emails to .eml files","user":{"login":"gabriel-v","id":7493327,"avatar_url":"https://avatars.githubusercontent.com/u/7493327?v=3","gravatar_id":"","url":"https://api.github.com/users/gabriel-v","html_url":"https://github.com/gabriel-v","followers_url":"https://api.github.com/users/gabriel-v/followers","following_url":"https://api.github.com/users/gabriel-v/following{/other_user}","gists_url":"https://api.github.com/users/gabriel-v/gists{/gist_id}","starred_url":"https://api.github.com/users/gabriel-v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabriel-v/subscriptions","organizations_url":"https://api.github.com/users/gabriel-v/orgs","repos_url":"https://api.github.com/users/gabriel-v/repos","events_url":"https://api.github.com/users/gabriel-v/events{/privacy}","received_events_url":"https://api.github.com/users/gabriel-v/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-07T21:35:48Z","updated_at":"2016-09-07T22:18:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"940befed3b0c75571234e9ce4513b0712cbec856","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hoover/snoop/pulls/13/commits","review_comments_url":"https://api.github.com/repos/hoover/snoop/pulls/13/comments","review_comment_url":"https://api.github.com/repos/hoover/snoop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hoover/snoop/issues/13/comments","statuses_url":"https://api.github.com/repos/hoover/snoop/statuses/22d0bbe8c5ca1ffce64ed89754d3cd5c7a4d5811","head":{"label":"hoover:export-pgp-as-eml","ref":"export-pgp-as-eml","sha":"22d0bbe8c5ca1ffce64ed89754d3cd5c7a4d5811","user":{"login":"hoover","id":21036123,"avatar_url":"https://avatars.githubusercontent.com/u/21036123?v=3","gravatar_id":"","url":"https://api.github.com/users/hoover","html_url":"https://github.com/hoover","followers_url":"https://api.github.com/users/hoover/followers","following_url":"https://api.github.com/users/hoover/following{/other_user}","gists_url":"https://api.github.com/users/hoover/gists{/gist_id}","starred_url":"https://api.github.com/users/hoover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoover/subscriptions","organizations_url":"https://api.github.com/users/hoover/orgs","repos_url":"https://api.github.com/users/hoover/repos","events_url":"https://api.github.com/users/hoover/events{/privacy}","received_events_url":"https://api.github.com/users/hoover/received_events","type":"Organization","site_admin":false},"repo":{"id":65765280,"name":"snoop","full_name":"hoover/snoop","owner":{"login":"hoover","id":21036123,"avatar_url":"https://avatars.githubusercontent.com/u/21036123?v=3","gravatar_id":"","url":"https://api.github.com/users/hoover","html_url":"https://github.com/hoover","followers_url":"https://api.github.com/users/hoover/followers","following_url":"https://api.github.com/users/hoover/following{/other_user}","gists_url":"https://api.github.com/users/hoover/gists{/gist_id}","starred_url":"https://api.github.com/users/hoover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoover/subscriptions","organizations_url":"https://api.github.com/users/hoover/orgs","repos_url":"https://api.github.com/users/hoover/repos","events_url":"https://api.github.com/users/hoover/events{/privacy}","received_events_url":"https://api.github.com/users/hoover/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hoover/snoop","description":null,"fork":false,"url":"https://api.github.com/repos/hoover/snoop","forks_url":"https://api.github.com/repos/hoover/snoop/forks","keys_url":"https://api.github.com/repos/hoover/snoop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hoover/snoop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hoover/snoop/teams","hooks_url":"https://api.github.com/repos/hoover/snoop/hooks","issue_events_url":"https://api.github.com/repos/hoover/snoop/issues/events{/number}","events_url":"https://api.github.com/repos/hoover/snoop/events","assignees_url":"https://api.github.com/repos/hoover/snoop/assignees{/user}","branches_url":"https://api.github.com/repos/hoover/snoop/branches{/branch}","tags_url":"https://api.github.com/repos/hoover/snoop/tags","blobs_url":"https://api.github.com/repos/hoover/snoop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hoover/snoop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hoover/snoop/git/refs{/sha}","trees_url":"https://api.github.com/repos/hoover/snoop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hoover/snoop/statuses/{sha}","languages_url":"https://api.github.com/repos/hoover/snoop/languages","stargazers_url":"https://api.github.com/repos/hoover/snoop/stargazers","contributors_url":"https://api.github.com/repos/hoover/snoop/contributors","subscribers_url":"https://api.github.com/repos/hoover/snoop/subscribers","subscription_url":"https://api.github.com/repos/hoover/snoop/subscription","commits_url":"https://api.github.com/repos/hoover/snoop/commits{/sha}","git_commits_url":"https://api.github.com/repos/hoover/snoop/git/commits{/sha}","comments_url":"https://api.github.com/repos/hoover/snoop/comments{/number}","issue_comment_url":"https://api.github.com/repos/hoover/snoop/issues/comments{/number}","contents_url":"https://api.github.com/repos/hoover/snoop/contents/{+path}","compare_url":"https://api.github.com/repos/hoover/snoop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hoover/snoop/merges","archive_url":"https://api.github.com/repos/hoover/snoop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hoover/snoop/downloads","issues_url":"https://api.github.com/repos/hoover/snoop/issues{/number}","pulls_url":"https://api.github.com/repos/hoover/snoop/pulls{/number}","milestones_url":"https://api.github.com/repos/hoover/snoop/milestones{/number}","notifications_url":"https://api.github.com/repos/hoover/snoop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hoover/snoop/labels{/name}","releases_url":"https://api.github.com/repos/hoover/snoop/releases{/id}","deployments_url":"https://api.github.com/repos/hoover/snoop/deployments","created_at":"2016-08-15T21:10:52Z","updated_at":"2016-08-15T21:11:51Z","pushed_at":"2016-09-07T22:03:10Z","git_url":"git://github.com/hoover/snoop.git","ssh_url":"git@github.com:hoover/snoop.git","clone_url":"https://github.com/hoover/snoop.git","svn_url":"https://github.com/hoover/snoop","homepage":null,"size":313,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"hoover:master","ref":"master","sha":"df521297462db944809a7b8a99c4383e7e3ed04a","user":{"login":"hoover","id":21036123,"avatar_url":"https://avatars.githubusercontent.com/u/21036123?v=3","gravatar_id":"","url":"https://api.github.com/users/hoover","html_url":"https://github.com/hoover","followers_url":"https://api.github.com/users/hoover/followers","following_url":"https://api.github.com/users/hoover/following{/other_user}","gists_url":"https://api.github.com/users/hoover/gists{/gist_id}","starred_url":"https://api.github.com/users/hoover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoover/subscriptions","organizations_url":"https://api.github.com/users/hoover/orgs","repos_url":"https://api.github.com/users/hoover/repos","events_url":"https://api.github.com/users/hoover/events{/privacy}","received_events_url":"https://api.github.com/users/hoover/received_events","type":"Organization","site_admin":false},"repo":{"id":65765280,"name":"snoop","full_name":"hoover/snoop","owner":{"login":"hoover","id":21036123,"avatar_url":"https://avatars.githubusercontent.com/u/21036123?v=3","gravatar_id":"","url":"https://api.github.com/users/hoover","html_url":"https://github.com/hoover","followers_url":"https://api.github.com/users/hoover/followers","following_url":"https://api.github.com/users/hoover/following{/other_user}","gists_url":"https://api.github.com/users/hoover/gists{/gist_id}","starred_url":"https://api.github.com/users/hoover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoover/subscriptions","organizations_url":"https://api.github.com/users/hoover/orgs","repos_url":"https://api.github.com/users/hoover/repos","events_url":"https://api.github.com/users/hoover/events{/privacy}","received_events_url":"https://api.github.com/users/hoover/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hoover/snoop","description":null,"fork":false,"url":"https://api.github.com/repos/hoover/snoop","forks_url":"https://api.github.com/repos/hoover/snoop/forks","keys_url":"https://api.github.com/repos/hoover/snoop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hoover/snoop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hoover/snoop/teams","hooks_url":"https://api.github.com/repos/hoover/snoop/hooks","issue_events_url":"https://api.github.com/repos/hoover/snoop/issues/events{/number}","events_url":"https://api.github.com/repos/hoover/snoop/events","assignees_url":"https://api.github.com/repos/hoover/snoop/assignees{/user}","branches_url":"https://api.github.com/repos/hoover/snoop/branches{/branch}","tags_url":"https://api.github.com/repos/hoover/snoop/tags","blobs_url":"https://api.github.com/repos/hoover/snoop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hoover/snoop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hoover/snoop/git/refs{/sha}","trees_url":"https://api.github.com/repos/hoover/snoop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hoover/snoop/statuses/{sha}","languages_url":"https://api.github.com/repos/hoover/snoop/languages","stargazers_url":"https://api.github.com/repos/hoover/snoop/stargazers","contributors_url":"https://api.github.com/repos/hoover/snoop/contributors","subscribers_url":"https://api.github.com/repos/hoover/snoop/subscribers","subscription_url":"https://api.github.com/repos/hoover/snoop/subscription","commits_url":"https://api.github.com/repos/hoover/snoop/commits{/sha}","git_commits_url":"https://api.github.com/repos/hoover/snoop/git/commits{/sha}","comments_url":"https://api.github.com/repos/hoover/snoop/comments{/number}","issue_comment_url":"https://api.github.com/repos/hoover/snoop/issues/comments{/number}","contents_url":"https://api.github.com/repos/hoover/snoop/contents/{+path}","compare_url":"https://api.github.com/repos/hoover/snoop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hoover/snoop/merges","archive_url":"https://api.github.com/repos/hoover/snoop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hoover/snoop/downloads","issues_url":"https://api.github.com/repos/hoover/snoop/issues{/number}","pulls_url":"https://api.github.com/repos/hoover/snoop/pulls{/number}","milestones_url":"https://api.github.com/repos/hoover/snoop/milestones{/number}","notifications_url":"https://api.github.com/repos/hoover/snoop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hoover/snoop/labels{/name}","releases_url":"https://api.github.com/repos/hoover/snoop/releases{/id}","deployments_url":"https://api.github.com/repos/hoover/snoop/deployments","created_at":"2016-08-15T21:10:52Z","updated_at":"2016-08-15T21:11:51Z","pushed_at":"2016-09-07T22:03:10Z","git_url":"git://github.com/hoover/snoop.git","ssh_url":"git@github.com:hoover/snoop.git","clone_url":"https://github.com/hoover/snoop.git","svn_url":"https://github.com/hoover/snoop","homepage":null,"size":313,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hoover/snoop/pulls/13"},"html":{"href":"https://github.com/hoover/snoop/pull/13"},"issue":{"href":"https://api.github.com/repos/hoover/snoop/issues/13"},"comments":{"href":"https://api.github.com/repos/hoover/snoop/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/hoover/snoop/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/hoover/snoop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hoover/snoop/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/hoover/snoop/statuses/22d0bbe8c5ca1ffce64ed89754d3cd5c7a4d5811"}}}}
{"actor":{"display_login":"mgax"}}