{"action":"created","comment":{"url":"https://api.github.com/repos/biocore/american-gut-web/pulls/comments/30852659","id":30852659,"diff_hunk":"@@ -0,0 +1,49 @@\n+from tornado.web import authenticated, HTTPError\n+\n+from os.path import join, exists\n+\n+from .base_handlers import BaseHandler\n+from amgut import AMGUT_CONFIG\n+from amgut.connections import ag_data\n+\n+\n+# {filetype from get: (local path, file suffix)}\n+FILETYPES = {'taxa': ('taxa-summaries', '.txt'),\n+             'result-pdf': ('pdfs', '.pdf')}\n+\n+\n+class DownloadHandler(BaseHandler):\n+    @authenticated\n+    def get(self, *args, **kwargs):\n+        barcode = self.get_argument('barcode', None)\n+        filetype = self.get_argument('filetype', None)\n+\n+        if barcode is None or filetype is None:\n+            raise HTTPError(500, \"Incorrectly formed GET request\")","path":"amgut/handlers/download.py","position":22,"original_position":22,"commit_id":"7ddf1eb93445946fd1de41365cf94e284c655a7a","original_commit_id":"7ddf1eb93445946fd1de41365cf94e284c655a7a","user":{"login":"wasade","id":474290,"avatar_url":"https://avatars.githubusercontent.com/u/474290?v=3","gravatar_id":"","url":"https://api.github.com/users/wasade","html_url":"https://github.com/wasade","followers_url":"https://api.github.com/users/wasade/followers","following_url":"https://api.github.com/users/wasade/following{/other_user}","gists_url":"https://api.github.com/users/wasade/gists{/gist_id}","starred_url":"https://api.github.com/users/wasade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wasade/subscriptions","organizations_url":"https://api.github.com/users/wasade/orgs","repos_url":"https://api.github.com/users/wasade/repos","events_url":"https://api.github.com/users/wasade/events{/privacy}","received_events_url":"https://api.github.com/users/wasade/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-05-21T22:02:21Z","updated_at":"2015-05-21T22:02:21Z","html_url":"https://github.com/biocore/american-gut-web/pull/420#discussion_r30852659","pull_request_url":"https://api.github.com/repos/biocore/american-gut-web/pulls/420","_links":{"self":{"href":"https://api.github.com/repos/biocore/american-gut-web/pulls/comments/30852659"},"html":{"href":"https://github.com/biocore/american-gut-web/pull/420#discussion_r30852659"},"pull_request":{"href":"https://api.github.com/repos/biocore/american-gut-web/pulls/420"}}},"pull_request":{"url":"https://api.github.com/repos/biocore/american-gut-web/pulls/420","id":35975247,"html_url":"https://github.com/biocore/american-gut-web/pull/420","diff_url":"https://github.com/biocore/american-gut-web/pull/420.diff","patch_url":"https://github.com/biocore/american-gut-web/pull/420.patch","issue_url":"https://api.github.com/repos/biocore/american-gut-web/issues/420","number":420,"state":"open","locked":false,"title":"Authed downloads","user":{"login":"wasade","id":474290,"avatar_url":"https://avatars.githubusercontent.com/u/474290?v=3","gravatar_id":"","url":"https://api.github.com/users/wasade","html_url":"https://github.com/wasade","followers_url":"https://api.github.com/users/wasade/followers","following_url":"https://api.github.com/users/wasade/following{/other_user}","gists_url":"https://api.github.com/users/wasade/gists{/gist_id}","starred_url":"https://api.github.com/users/wasade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wasade/subscriptions","organizations_url":"https://api.github.com/users/wasade/orgs","repos_url":"https://api.github.com/users/wasade/repos","events_url":"https://api.github.com/users/wasade/events{/privacy}","received_events_url":"https://api.github.com/users/wasade/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-21T20:42:02Z","updated_at":"2015-05-21T22:02:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37b6765d37f50e29e264e14fccac4a8aa297dd74","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/biocore/american-gut-web/pulls/420/commits","review_comments_url":"https://api.github.com/repos/biocore/american-gut-web/pulls/420/comments","review_comment_url":"https://api.github.com/repos/biocore/american-gut-web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/biocore/american-gut-web/issues/420/comments","statuses_url":"https://api.github.com/repos/biocore/american-gut-web/statuses/7ddf1eb93445946fd1de41365cf94e284c655a7a","head":{"label":"wasade:authed_downloads","ref":"authed_downloads","sha":"7ddf1eb93445946fd1de41365cf94e284c655a7a","user":{"login":"wasade","id":474290,"avatar_url":"https://avatars.githubusercontent.com/u/474290?v=3","gravatar_id":"","url":"https://api.github.com/users/wasade","html_url":"https://github.com/wasade","followers_url":"https://api.github.com/users/wasade/followers","following_url":"https://api.github.com/users/wasade/following{/other_user}","gists_url":"https://api.github.com/users/wasade/gists{/gist_id}","starred_url":"https://api.github.com/users/wasade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wasade/subscriptions","organizations_url":"https://api.github.com/users/wasade/orgs","repos_url":"https://api.github.com/users/wasade/repos","events_url":"https://api.github.com/users/wasade/events{/privacy}","received_events_url":"https://api.github.com/users/wasade/received_events","type":"User","site_admin":false},"repo":{"id":23117167,"name":"american-gut-web","full_name":"wasade/american-gut-web","owner":{"login":"wasade","id":474290,"avatar_url":"https://avatars.githubusercontent.com/u/474290?v=3","gravatar_id":"","url":"https://api.github.com/users/wasade","html_url":"https://github.com/wasade","followers_url":"https://api.github.com/users/wasade/followers","following_url":"https://api.github.com/users/wasade/following{/other_user}","gists_url":"https://api.github.com/users/wasade/gists{/gist_id}","starred_url":"https://api.github.com/users/wasade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wasade/subscriptions","organizations_url":"https://api.github.com/users/wasade/orgs","repos_url":"https://api.github.com/users/wasade/repos","events_url":"https://api.github.com/users/wasade/events{/privacy}","received_events_url":"https://api.github.com/users/wasade/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wasade/american-gut-web","description":"The website for the American Gut Project participant portal","fork":true,"url":"https://api.github.com/repos/wasade/american-gut-web","forks_url":"https://api.github.com/repos/wasade/american-gut-web/forks","keys_url":"https://api.github.com/repos/wasade/american-gut-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wasade/american-gut-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wasade/american-gut-web/teams","hooks_url":"https://api.github.com/repos/wasade/american-gut-web/hooks","issue_events_url":"https://api.github.com/repos/wasade/american-gut-web/issues/events{/number}","events_url":"https://api.github.com/repos/wasade/american-gut-web/events","assignees_url":"https://api.github.com/repos/wasade/american-gut-web/assignees{/user}","branches_url":"https://api.github.com/repos/wasade/american-gut-web/branches{/branch}","tags_url":"https://api.github.com/repos/wasade/american-gut-web/tags","blobs_url":"https://api.github.com/repos/wasade/american-gut-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wasade/american-gut-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wasade/american-gut-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/wasade/american-gut-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wasade/american-gut-web/statuses/{sha}","languages_url":"https://api.github.com/repos/wasade/american-gut-web/languages","stargazers_url":"https://api.github.com/repos/wasade/american-gut-web/stargazers","contributors_url":"https://api.github.com/repos/wasade/american-gut-web/contributors","subscribers_url":"https://api.github.com/repos/wasade/american-gut-web/subscribers","subscription_url":"https://api.github.com/repos/wasade/american-gut-web/subscription","commits_url":"https://api.github.com/repos/wasade/american-gut-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/wasade/american-gut-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/wasade/american-gut-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/wasade/american-gut-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/wasade/american-gut-web/contents/{+path}","compare_url":"https://api.github.com/repos/wasade/american-gut-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wasade/american-gut-web/merges","archive_url":"https://api.github.com/repos/wasade/american-gut-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wasade/american-gut-web/downloads","issues_url":"https://api.github.com/repos/wasade/american-gut-web/issues{/number}","pulls_url":"https://api.github.com/repos/wasade/american-gut-web/pulls{/number}","milestones_url":"https://api.github.com/repos/wasade/american-gut-web/milestones{/number}","notifications_url":"https://api.github.com/repos/wasade/american-gut-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wasade/american-gut-web/labels{/name}","releases_url":"https://api.github.com/repos/wasade/american-gut-web/releases{/id}","created_at":"2014-08-19T16:23:14Z","updated_at":"2014-08-20T15:37:33Z","pushed_at":"2015-05-21T21:35:46Z","git_url":"git://github.com/wasade/american-gut-web.git","ssh_url":"git@github.com:wasade/american-gut-web.git","clone_url":"https://github.com/wasade/american-gut-web.git","svn_url":"https://github.com/wasade/american-gut-web","homepage":null,"size":49728,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"biocore:master","ref":"master","sha":"5fa3d0c50d1b083b7f78fff643c8db3c06b022e7","user":{"login":"biocore","id":6241857,"avatar_url":"https://avatars.githubusercontent.com/u/6241857?v=3","gravatar_id":"","url":"https://api.github.com/users/biocore","html_url":"https://github.com/biocore","followers_url":"https://api.github.com/users/biocore/followers","following_url":"https://api.github.com/users/biocore/following{/other_user}","gists_url":"https://api.github.com/users/biocore/gists{/gist_id}","starred_url":"https://api.github.com/users/biocore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biocore/subscriptions","organizations_url":"https://api.github.com/users/biocore/orgs","repos_url":"https://api.github.com/users/biocore/repos","events_url":"https://api.github.com/users/biocore/events{/privacy}","received_events_url":"https://api.github.com/users/biocore/received_events","type":"Organization","site_admin":false},"repo":{"id":22621149,"name":"american-gut-web","full_name":"biocore/american-gut-web","owner":{"login":"biocore","id":6241857,"avatar_url":"https://avatars.githubusercontent.com/u/6241857?v=3","gravatar_id":"","url":"https://api.github.com/users/biocore","html_url":"https://github.com/biocore","followers_url":"https://api.github.com/users/biocore/followers","following_url":"https://api.github.com/users/biocore/following{/other_user}","gists_url":"https://api.github.com/users/biocore/gists{/gist_id}","starred_url":"https://api.github.com/users/biocore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biocore/subscriptions","organizations_url":"https://api.github.com/users/biocore/orgs","repos_url":"https://api.github.com/users/biocore/repos","events_url":"https://api.github.com/users/biocore/events{/privacy}","received_events_url":"https://api.github.com/users/biocore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/biocore/american-gut-web","description":"The website for the American Gut Project participant portal","fork":false,"url":"https://api.github.com/repos/biocore/american-gut-web","forks_url":"https://api.github.com/repos/biocore/american-gut-web/forks","keys_url":"https://api.github.com/repos/biocore/american-gut-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biocore/american-gut-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biocore/american-gut-web/teams","hooks_url":"https://api.github.com/repos/biocore/american-gut-web/hooks","issue_events_url":"https://api.github.com/repos/biocore/american-gut-web/issues/events{/number}","events_url":"https://api.github.com/repos/biocore/american-gut-web/events","assignees_url":"https://api.github.com/repos/biocore/american-gut-web/assignees{/user}","branches_url":"https://api.github.com/repos/biocore/american-gut-web/branches{/branch}","tags_url":"https://api.github.com/repos/biocore/american-gut-web/tags","blobs_url":"https://api.github.com/repos/biocore/american-gut-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biocore/american-gut-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biocore/american-gut-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/biocore/american-gut-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biocore/american-gut-web/statuses/{sha}","languages_url":"https://api.github.com/repos/biocore/american-gut-web/languages","stargazers_url":"https://api.github.com/repos/biocore/american-gut-web/stargazers","contributors_url":"https://api.github.com/repos/biocore/american-gut-web/contributors","subscribers_url":"https://api.github.com/repos/biocore/american-gut-web/subscribers","subscription_url":"https://api.github.com/repos/biocore/american-gut-web/subscription","commits_url":"https://api.github.com/repos/biocore/american-gut-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/biocore/american-gut-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/biocore/american-gut-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/biocore/american-gut-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/biocore/american-gut-web/contents/{+path}","compare_url":"https://api.github.com/repos/biocore/american-gut-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biocore/american-gut-web/merges","archive_url":"https://api.github.com/repos/biocore/american-gut-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biocore/american-gut-web/downloads","issues_url":"https://api.github.com/repos/biocore/american-gut-web/issues{/number}","pulls_url":"https://api.github.com/repos/biocore/american-gut-web/pulls{/number}","milestones_url":"https://api.github.com/repos/biocore/american-gut-web/milestones{/number}","notifications_url":"https://api.github.com/repos/biocore/american-gut-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biocore/american-gut-web/labels{/name}","releases_url":"https://api.github.com/repos/biocore/american-gut-web/releases{/id}","created_at":"2014-08-04T21:47:22Z","updated_at":"2015-05-07T01:44:12Z","pushed_at":"2015-05-21T21:35:47Z","git_url":"git://github.com/biocore/american-gut-web.git","ssh_url":"git@github.com:biocore/american-gut-web.git","clone_url":"https://github.com/biocore/american-gut-web.git","svn_url":"https://github.com/biocore/american-gut-web","homepage":null,"size":76379,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":41,"forks":12,"open_issues":41,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/biocore/american-gut-web/pulls/420"},"html":{"href":"https://github.com/biocore/american-gut-web/pull/420"},"issue":{"href":"https://api.github.com/repos/biocore/american-gut-web/issues/420"},"comments":{"href":"https://api.github.com/repos/biocore/american-gut-web/issues/420/comments"},"review_comments":{"href":"https://api.github.com/repos/biocore/american-gut-web/pulls/420/comments"},"review_comment":{"href":"https://api.github.com/repos/biocore/american-gut-web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/biocore/american-gut-web/pulls/420/commits"},"statuses":{"href":"https://api.github.com/repos/biocore/american-gut-web/statuses/7ddf1eb93445946fd1de41365cf94e284c655a7a"}}}}