{"action":"created","comment":{"url":"https://api.github.com/repos/18F/openFEC-web-app/pulls/comments/55831492","id":55831492,"diff_hunk":"@@ -0,0 +1,191 @@\n+import re\n+import json\n+import locale\n+import hashlib\n+import datetime\n+\n+import furl\n+from raven.contrib.flask import Sentry\n+\n+from hmac_authentication import hmacauth\n+from flask import Flask, render_template, request, url_for\n+from flask_sslify import SSLify\n+from werkzeug.contrib.fixers import ProxyFix\n+\n+from openfecwebapp import utils\n+from openfecwebapp import views\n+from openfecwebapp import config\n+from openfecwebapp.config import env\n+from openfecwebapp import constants\n+\n+\n+locale.setlocale(locale.LC_ALL, '')\n+\n+app = Flask(__name__, static_path='/static', static_folder='../dist')\n+\n+from openfecwebapp import routes  # noqa\n+from openfecwebapp import filters  # noqa\n+\n+\n+def get_absolute_url():\n+    url = furl.furl(request.url)\n+    if app.config['SERVER_NAME']:\n+        url.host = app.config['SERVER_NAME']\n+        url.scheme = app.config['PREFERRED_URL_SCHEME']\n+    return url.url\n+\n+\n+def _get_default_cycles():\n+    cycle = utils.current_cycle()\n+    return list(range(cycle - 4, cycle + 2, 2))\n+\n+\n+def series_has_data(values, key):\n+    return next(\n+        (True for value in values if value.get(key) is not None),\n+        False,\n+    )","path":"openfecwebapp/__init__.py","position":47,"original_position":47,"commit_id":"018b99c20a5f110fc3ac1fdce58cbc39fea5368a","original_commit_id":"a826f9e1368d226b7bfe82bd511316bb1dd3669d","user":{"login":"ccostino","id":121565,"avatar_url":"https://avatars.githubusercontent.com/u/121565?v=3","gravatar_id":"","url":"https://api.github.com/users/ccostino","html_url":"https://github.com/ccostino","followers_url":"https://api.github.com/users/ccostino/followers","following_url":"https://api.github.com/users/ccostino/following{/other_user}","gists_url":"https://api.github.com/users/ccostino/gists{/gist_id}","starred_url":"https://api.github.com/users/ccostino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccostino/subscriptions","organizations_url":"https://api.github.com/users/ccostino/orgs","repos_url":"https://api.github.com/users/ccostino/repos","events_url":"https://api.github.com/users/ccostino/events{/privacy}","received_events_url":"https://api.github.com/users/ccostino/received_events","type":"User","site_admin":false},"body":"Hahaha, fair enough!  Adding to my list of things to investigate further in the future. :-)","created_at":"2016-03-11T13:58:37Z","updated_at":"2016-03-11T13:58:37Z","html_url":"https://github.com/18F/openFEC-web-app/pull/1111#discussion_r55831492","pull_request_url":"https://api.github.com/repos/18F/openFEC-web-app/pulls/1111","_links":{"self":{"href":"https://api.github.com/repos/18F/openFEC-web-app/pulls/comments/55831492"},"html":{"href":"https://github.com/18F/openFEC-web-app/pull/1111#discussion_r55831492"},"pull_request":{"href":"https://api.github.com/repos/18F/openFEC-web-app/pulls/1111"}}},"pull_request":{"url":"https://api.github.com/repos/18F/openFEC-web-app/pulls/1111","id":61026679,"html_url":"https://github.com/18F/openFEC-web-app/pull/1111","diff_url":"https://github.com/18F/openFEC-web-app/pull/1111.diff","patch_url":"https://github.com/18F/openFEC-web-app/pull/1111.patch","issue_url":"https://api.github.com/repos/18F/openFEC-web-app/issues/1111","number":1111,"state":"open","locked":false,"title":"Feature/organize modules","user":{"login":"jmcarp","id":1633460,"avatar_url":"https://avatars.githubusercontent.com/u/1633460?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcarp","html_url":"https://github.com/jmcarp","followers_url":"https://api.github.com/users/jmcarp/followers","following_url":"https://api.github.com/users/jmcarp/following{/other_user}","gists_url":"https://api.github.com/users/jmcarp/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcarp/subscriptions","organizations_url":"https://api.github.com/users/jmcarp/orgs","repos_url":"https://api.github.com/users/jmcarp/repos","events_url":"https://api.github.com/users/jmcarp/events{/privacy}","received_events_url":"https://api.github.com/users/jmcarp/received_events","type":"User","site_admin":false},"body":"The `__init__.py` file is approaching 500 lines and is getting increasingly disorganized. This patch splits up functionality into modules by file. This also wraps app invocation in a more standard `manage.py`, so the development app is started with `python manage.py runserver` rather than `python __init__.py`.\r\n\r\nThere's more cleanup that could be done here, but I think this is a reasonable start.","created_at":"2016-02-29T04:28:39Z","updated_at":"2016-03-11T13:58:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ff0037bcdf815bbfc914c6b1471f77c816b9300","assignee":{"login":"ccostino","id":121565,"avatar_url":"https://avatars.githubusercontent.com/u/121565?v=3","gravatar_id":"","url":"https://api.github.com/users/ccostino","html_url":"https://github.com/ccostino","followers_url":"https://api.github.com/users/ccostino/followers","following_url":"https://api.github.com/users/ccostino/following{/other_user}","gists_url":"https://api.github.com/users/ccostino/gists{/gist_id}","starred_url":"https://api.github.com/users/ccostino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccostino/subscriptions","organizations_url":"https://api.github.com/users/ccostino/orgs","repos_url":"https://api.github.com/users/ccostino/repos","events_url":"https://api.github.com/users/ccostino/events{/privacy}","received_events_url":"https://api.github.com/users/ccostino/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/18F/openFEC-web-app/pulls/1111/commits","review_comments_url":"https://api.github.com/repos/18F/openFEC-web-app/pulls/1111/comments","review_comment_url":"https://api.github.com/repos/18F/openFEC-web-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/openFEC-web-app/issues/1111/comments","statuses_url":"https://api.github.com/repos/18F/openFEC-web-app/statuses/018b99c20a5f110fc3ac1fdce58cbc39fea5368a","head":{"label":"jmcarp:feature/organize-modules","ref":"feature/organize-modules","sha":"018b99c20a5f110fc3ac1fdce58cbc39fea5368a","user":{"login":"jmcarp","id":1633460,"avatar_url":"https://avatars.githubusercontent.com/u/1633460?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcarp","html_url":"https://github.com/jmcarp","followers_url":"https://api.github.com/users/jmcarp/followers","following_url":"https://api.github.com/users/jmcarp/following{/other_user}","gists_url":"https://api.github.com/users/jmcarp/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcarp/subscriptions","organizations_url":"https://api.github.com/users/jmcarp/orgs","repos_url":"https://api.github.com/users/jmcarp/repos","events_url":"https://api.github.com/users/jmcarp/events{/privacy}","received_events_url":"https://api.github.com/users/jmcarp/received_events","type":"User","site_admin":false},"repo":{"id":33632247,"name":"openFEC-web-app","full_name":"jmcarp/openFEC-web-app","owner":{"login":"jmcarp","id":1633460,"avatar_url":"https://avatars.githubusercontent.com/u/1633460?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcarp","html_url":"https://github.com/jmcarp","followers_url":"https://api.github.com/users/jmcarp/followers","following_url":"https://api.github.com/users/jmcarp/following{/other_user}","gists_url":"https://api.github.com/users/jmcarp/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcarp/subscriptions","organizations_url":"https://api.github.com/users/jmcarp/orgs","repos_url":"https://api.github.com/users/jmcarp/repos","events_url":"https://api.github.com/users/jmcarp/events{/privacy}","received_events_url":"https://api.github.com/users/jmcarp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmcarp/openFEC-web-app","description":"Server- and client-side web application for the OpenFEC data site.","fork":true,"url":"https://api.github.com/repos/jmcarp/openFEC-web-app","forks_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/forks","keys_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/teams","hooks_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/hooks","issue_events_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/issues/events{/number}","events_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/events","assignees_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/assignees{/user}","branches_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/branches{/branch}","tags_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/tags","blobs_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/statuses/{sha}","languages_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/languages","stargazers_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/stargazers","contributors_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/contributors","subscribers_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/subscribers","subscription_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/subscription","commits_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/contents/{+path}","compare_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/merges","archive_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/downloads","issues_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/issues{/number}","pulls_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/pulls{/number}","milestones_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/milestones{/number}","notifications_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/labels{/name}","releases_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/releases{/id}","deployments_url":"https://api.github.com/repos/jmcarp/openFEC-web-app/deployments","created_at":"2015-04-08T21:06:00Z","updated_at":"2015-04-08T21:06:01Z","pushed_at":"2016-03-10T23:04:28Z","git_url":"git://github.com/jmcarp/openFEC-web-app.git","ssh_url":"git@github.com:jmcarp/openFEC-web-app.git","clone_url":"https://github.com/jmcarp/openFEC-web-app.git","svn_url":"https://github.com/jmcarp/openFEC-web-app","homepage":"","size":12258,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"18F:develop","ref":"develop","sha":"553527429dbf5222fe557157ed1c0e6d355107c0","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":25273785,"name":"openFEC-web-app","full_name":"18F/openFEC-web-app","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/openFEC-web-app","description":"The betaFEC web app for exploring campaign finance data","fork":false,"url":"https://api.github.com/repos/18F/openFEC-web-app","forks_url":"https://api.github.com/repos/18F/openFEC-web-app/forks","keys_url":"https://api.github.com/repos/18F/openFEC-web-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/openFEC-web-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/openFEC-web-app/teams","hooks_url":"https://api.github.com/repos/18F/openFEC-web-app/hooks","issue_events_url":"https://api.github.com/repos/18F/openFEC-web-app/issues/events{/number}","events_url":"https://api.github.com/repos/18F/openFEC-web-app/events","assignees_url":"https://api.github.com/repos/18F/openFEC-web-app/assignees{/user}","branches_url":"https://api.github.com/repos/18F/openFEC-web-app/branches{/branch}","tags_url":"https://api.github.com/repos/18F/openFEC-web-app/tags","blobs_url":"https://api.github.com/repos/18F/openFEC-web-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/openFEC-web-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/openFEC-web-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/openFEC-web-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/openFEC-web-app/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/openFEC-web-app/languages","stargazers_url":"https://api.github.com/repos/18F/openFEC-web-app/stargazers","contributors_url":"https://api.github.com/repos/18F/openFEC-web-app/contributors","subscribers_url":"https://api.github.com/repos/18F/openFEC-web-app/subscribers","subscription_url":"https://api.github.com/repos/18F/openFEC-web-app/subscription","commits_url":"https://api.github.com/repos/18F/openFEC-web-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/openFEC-web-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/openFEC-web-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/openFEC-web-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/openFEC-web-app/contents/{+path}","compare_url":"https://api.github.com/repos/18F/openFEC-web-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/openFEC-web-app/merges","archive_url":"https://api.github.com/repos/18F/openFEC-web-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/openFEC-web-app/downloads","issues_url":"https://api.github.com/repos/18F/openFEC-web-app/issues{/number}","pulls_url":"https://api.github.com/repos/18F/openFEC-web-app/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/openFEC-web-app/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/openFEC-web-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/openFEC-web-app/labels{/name}","releases_url":"https://api.github.com/repos/18F/openFEC-web-app/releases{/id}","deployments_url":"https://api.github.com/repos/18F/openFEC-web-app/deployments","created_at":"2014-10-15T21:12:32Z","updated_at":"2016-03-03T03:04:57Z","pushed_at":"2016-03-11T03:30:00Z","git_url":"git://github.com/18F/openFEC-web-app.git","ssh_url":"git@github.com:18F/openFEC-web-app.git","clone_url":"https://github.com/18F/openFEC-web-app.git","svn_url":"https://github.com/18F/openFEC-web-app","homepage":"https://beta.fec.gov/data","size":12406,"stargazers_count":24,"watchers_count":24,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":73,"forks":13,"open_issues":73,"watchers":24,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/openFEC-web-app/pulls/1111"},"html":{"href":"https://github.com/18F/openFEC-web-app/pull/1111"},"issue":{"href":"https://api.github.com/repos/18F/openFEC-web-app/issues/1111"},"comments":{"href":"https://api.github.com/repos/18F/openFEC-web-app/issues/1111/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/openFEC-web-app/pulls/1111/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/openFEC-web-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/openFEC-web-app/pulls/1111/commits"},"statuses":{"href":"https://api.github.com/repos/18F/openFEC-web-app/statuses/018b99c20a5f110fc3ac1fdce58cbc39fea5368a"}}}}