{"action":"created","comment":{"url":"https://api.github.com/repos/eungyu/paragraph/pulls/comments/31203137","id":31203137,"diff_hunk":"@@ -0,0 +1,216 @@\n+import uuid\n+import time\n+import json\n+import dropbox\n+import StringIO\n+\n+from flask import Flask\n+from flask import g, request, jsonify, Response\n+from flask.ext.cache import Cache\n+\n+from responsewitherror import ResponseWithError\n+\n+app = Flask(__name__)\n+app.debug = True\n+app.config.from_object('config')\n+\n+def get_client():\n+  client = getattr(g, '_client', None)\n+  if client is None:\n+    client = dropbox.client.DropboxClient(app.config['ACCESS_TOKEN'])\n+    g._client = client\n+\n+  return client\n+\n+def emptythread(threadid):\n+  return {\n+    \"threadid\" : str(threadid),\n+    \"entries\"  : []\n+  }\n+\n+def getdatapath(threadid):\n+  return \"/data/%s.json\" % threadid","path":"app/para.py","position":32,"original_position":32,"commit_id":"682cec577579ecec71dcddd0f340e80db56caf02","original_commit_id":"682cec577579ecec71dcddd0f340e80db56caf02","user":{"login":"suchanlee","id":3934894,"avatar_url":"https://avatars.githubusercontent.com/u/3934894?v=3","gravatar_id":"","url":"https://api.github.com/users/suchanlee","html_url":"https://github.com/suchanlee","followers_url":"https://api.github.com/users/suchanlee/followers","following_url":"https://api.github.com/users/suchanlee/following{/other_user}","gists_url":"https://api.github.com/users/suchanlee/gists{/gist_id}","starred_url":"https://api.github.com/users/suchanlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suchanlee/subscriptions","organizations_url":"https://api.github.com/users/suchanlee/orgs","repos_url":"https://api.github.com/users/suchanlee/repos","events_url":"https://api.github.com/users/suchanlee/events{/privacy}","received_events_url":"https://api.github.com/users/suchanlee/received_events","type":"User","site_admin":false},"body":"Oh okay, I didn't realize that it's a relative path to the app directory -- looks good!","created_at":"2015-05-28T04:52:15Z","updated_at":"2015-05-28T04:52:15Z","html_url":"https://github.com/eungyu/paragraph/pull/46#discussion_r31203137","pull_request_url":"https://api.github.com/repos/eungyu/paragraph/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/eungyu/paragraph/pulls/comments/31203137"},"html":{"href":"https://github.com/eungyu/paragraph/pull/46#discussion_r31203137"},"pull_request":{"href":"https://api.github.com/repos/eungyu/paragraph/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/eungyu/paragraph/pulls/46","id":36274765,"html_url":"https://github.com/eungyu/paragraph/pull/46","diff_url":"https://github.com/eungyu/paragraph/pull/46.diff","patch_url":"https://github.com/eungyu/paragraph/pull/46.patch","issue_url":"https://api.github.com/repos/eungyu/paragraph/issues/46","number":46,"state":"open","locked":false,"title":"Paragraph Reimplemented With Dropbox Core API","user":{"login":"eungyu","id":2310,"avatar_url":"https://avatars.githubusercontent.com/u/2310?v=3","gravatar_id":"","url":"https://api.github.com/users/eungyu","html_url":"https://github.com/eungyu","followers_url":"https://api.github.com/users/eungyu/followers","following_url":"https://api.github.com/users/eungyu/following{/other_user}","gists_url":"https://api.github.com/users/eungyu/gists{/gist_id}","starred_url":"https://api.github.com/users/eungyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eungyu/subscriptions","organizations_url":"https://api.github.com/users/eungyu/orgs","repos_url":"https://api.github.com/users/eungyu/repos","events_url":"https://api.github.com/users/eungyu/events{/privacy}","received_events_url":"https://api.github.com/users/eungyu/received_events","type":"User","site_admin":false},"body":"Paragraph is now ready with Core API. There is no separate store for counter and records. Each comment thread is a json file that is structured as the following.\r\n\r\n```json\r\n{\r\n  \"threadid\": \"300\",\r\n  \"entries\": [\r\n    { \"entryid\" : \"urn:uuid:abcd-1234\", \r\n      \"content\" : \"Hello, World\",\r\n      \"author\": \"eungyu\",\r\n      \"modified\" : 123124234,\r\n      \"created\" : 123435234,\r\n      \"passhash\" : \"adfkjdkhgkdjdkj\"\r\n    },\r\n    { ... }\r\n  ]\r\n}\r\n```\r\n\r\nOptimistic lock is used for writes using previous revision number. Latency is tolerable. Caching to follow later.","created_at":"2015-05-27T07:07:24Z","updated_at":"2015-05-28T04:52:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9678a5786ad316d0b820c75c4c6a2ea7c6b0c593","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/eungyu/paragraph/pulls/46/commits","review_comments_url":"https://api.github.com/repos/eungyu/paragraph/pulls/46/comments","review_comment_url":"https://api.github.com/repos/eungyu/paragraph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eungyu/paragraph/issues/46/comments","statuses_url":"https://api.github.com/repos/eungyu/paragraph/statuses/682cec577579ecec71dcddd0f340e80db56caf02","head":{"label":"eungyu:paragraph-with-core-api","ref":"paragraph-with-core-api","sha":"682cec577579ecec71dcddd0f340e80db56caf02","user":{"login":"eungyu","id":2310,"avatar_url":"https://avatars.githubusercontent.com/u/2310?v=3","gravatar_id":"","url":"https://api.github.com/users/eungyu","html_url":"https://github.com/eungyu","followers_url":"https://api.github.com/users/eungyu/followers","following_url":"https://api.github.com/users/eungyu/following{/other_user}","gists_url":"https://api.github.com/users/eungyu/gists{/gist_id}","starred_url":"https://api.github.com/users/eungyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eungyu/subscriptions","organizations_url":"https://api.github.com/users/eungyu/orgs","repos_url":"https://api.github.com/users/eungyu/repos","events_url":"https://api.github.com/users/eungyu/events{/privacy}","received_events_url":"https://api.github.com/users/eungyu/received_events","type":"User","site_admin":false},"repo":{"id":27471301,"name":"paragraph","full_name":"eungyu/paragraph","owner":{"login":"eungyu","id":2310,"avatar_url":"https://avatars.githubusercontent.com/u/2310?v=3","gravatar_id":"","url":"https://api.github.com/users/eungyu","html_url":"https://github.com/eungyu","followers_url":"https://api.github.com/users/eungyu/followers","following_url":"https://api.github.com/users/eungyu/following{/other_user}","gists_url":"https://api.github.com/users/eungyu/gists{/gist_id}","starred_url":"https://api.github.com/users/eungyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eungyu/subscriptions","organizations_url":"https://api.github.com/users/eungyu/orgs","repos_url":"https://api.github.com/users/eungyu/repos","events_url":"https://api.github.com/users/eungyu/events{/privacy}","received_events_url":"https://api.github.com/users/eungyu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eungyu/paragraph","description":"Dropbox Based Comment Store","fork":false,"url":"https://api.github.com/repos/eungyu/paragraph","forks_url":"https://api.github.com/repos/eungyu/paragraph/forks","keys_url":"https://api.github.com/repos/eungyu/paragraph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eungyu/paragraph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eungyu/paragraph/teams","hooks_url":"https://api.github.com/repos/eungyu/paragraph/hooks","issue_events_url":"https://api.github.com/repos/eungyu/paragraph/issues/events{/number}","events_url":"https://api.github.com/repos/eungyu/paragraph/events","assignees_url":"https://api.github.com/repos/eungyu/paragraph/assignees{/user}","branches_url":"https://api.github.com/repos/eungyu/paragraph/branches{/branch}","tags_url":"https://api.github.com/repos/eungyu/paragraph/tags","blobs_url":"https://api.github.com/repos/eungyu/paragraph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eungyu/paragraph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eungyu/paragraph/git/refs{/sha}","trees_url":"https://api.github.com/repos/eungyu/paragraph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eungyu/paragraph/statuses/{sha}","languages_url":"https://api.github.com/repos/eungyu/paragraph/languages","stargazers_url":"https://api.github.com/repos/eungyu/paragraph/stargazers","contributors_url":"https://api.github.com/repos/eungyu/paragraph/contributors","subscribers_url":"https://api.github.com/repos/eungyu/paragraph/subscribers","subscription_url":"https://api.github.com/repos/eungyu/paragraph/subscription","commits_url":"https://api.github.com/repos/eungyu/paragraph/commits{/sha}","git_commits_url":"https://api.github.com/repos/eungyu/paragraph/git/commits{/sha}","comments_url":"https://api.github.com/repos/eungyu/paragraph/comments{/number}","issue_comment_url":"https://api.github.com/repos/eungyu/paragraph/issues/comments{/number}","contents_url":"https://api.github.com/repos/eungyu/paragraph/contents/{+path}","compare_url":"https://api.github.com/repos/eungyu/paragraph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eungyu/paragraph/merges","archive_url":"https://api.github.com/repos/eungyu/paragraph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eungyu/paragraph/downloads","issues_url":"https://api.github.com/repos/eungyu/paragraph/issues{/number}","pulls_url":"https://api.github.com/repos/eungyu/paragraph/pulls{/number}","milestones_url":"https://api.github.com/repos/eungyu/paragraph/milestones{/number}","notifications_url":"https://api.github.com/repos/eungyu/paragraph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eungyu/paragraph/labels{/name}","releases_url":"https://api.github.com/repos/eungyu/paragraph/releases{/id}","created_at":"2014-12-03T05:37:44Z","updated_at":"2015-03-11T16:39:28Z","pushed_at":"2015-05-27T07:07:24Z","git_url":"git://github.com/eungyu/paragraph.git","ssh_url":"git@github.com:eungyu/paragraph.git","clone_url":"https://github.com/eungyu/paragraph.git","svn_url":"https://github.com/eungyu/paragraph","homepage":null,"size":788,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":2,"default_branch":"master"}},"base":{"label":"eungyu:master","ref":"master","sha":"0776329d4cac626268dff0fc1ffbab23a4aea86d","user":{"login":"eungyu","id":2310,"avatar_url":"https://avatars.githubusercontent.com/u/2310?v=3","gravatar_id":"","url":"https://api.github.com/users/eungyu","html_url":"https://github.com/eungyu","followers_url":"https://api.github.com/users/eungyu/followers","following_url":"https://api.github.com/users/eungyu/following{/other_user}","gists_url":"https://api.github.com/users/eungyu/gists{/gist_id}","starred_url":"https://api.github.com/users/eungyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eungyu/subscriptions","organizations_url":"https://api.github.com/users/eungyu/orgs","repos_url":"https://api.github.com/users/eungyu/repos","events_url":"https://api.github.com/users/eungyu/events{/privacy}","received_events_url":"https://api.github.com/users/eungyu/received_events","type":"User","site_admin":false},"repo":{"id":27471301,"name":"paragraph","full_name":"eungyu/paragraph","owner":{"login":"eungyu","id":2310,"avatar_url":"https://avatars.githubusercontent.com/u/2310?v=3","gravatar_id":"","url":"https://api.github.com/users/eungyu","html_url":"https://github.com/eungyu","followers_url":"https://api.github.com/users/eungyu/followers","following_url":"https://api.github.com/users/eungyu/following{/other_user}","gists_url":"https://api.github.com/users/eungyu/gists{/gist_id}","starred_url":"https://api.github.com/users/eungyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eungyu/subscriptions","organizations_url":"https://api.github.com/users/eungyu/orgs","repos_url":"https://api.github.com/users/eungyu/repos","events_url":"https://api.github.com/users/eungyu/events{/privacy}","received_events_url":"https://api.github.com/users/eungyu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eungyu/paragraph","description":"Dropbox Based Comment Store","fork":false,"url":"https://api.github.com/repos/eungyu/paragraph","forks_url":"https://api.github.com/repos/eungyu/paragraph/forks","keys_url":"https://api.github.com/repos/eungyu/paragraph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eungyu/paragraph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eungyu/paragraph/teams","hooks_url":"https://api.github.com/repos/eungyu/paragraph/hooks","issue_events_url":"https://api.github.com/repos/eungyu/paragraph/issues/events{/number}","events_url":"https://api.github.com/repos/eungyu/paragraph/events","assignees_url":"https://api.github.com/repos/eungyu/paragraph/assignees{/user}","branches_url":"https://api.github.com/repos/eungyu/paragraph/branches{/branch}","tags_url":"https://api.github.com/repos/eungyu/paragraph/tags","blobs_url":"https://api.github.com/repos/eungyu/paragraph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eungyu/paragraph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eungyu/paragraph/git/refs{/sha}","trees_url":"https://api.github.com/repos/eungyu/paragraph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eungyu/paragraph/statuses/{sha}","languages_url":"https://api.github.com/repos/eungyu/paragraph/languages","stargazers_url":"https://api.github.com/repos/eungyu/paragraph/stargazers","contributors_url":"https://api.github.com/repos/eungyu/paragraph/contributors","subscribers_url":"https://api.github.com/repos/eungyu/paragraph/subscribers","subscription_url":"https://api.github.com/repos/eungyu/paragraph/subscription","commits_url":"https://api.github.com/repos/eungyu/paragraph/commits{/sha}","git_commits_url":"https://api.github.com/repos/eungyu/paragraph/git/commits{/sha}","comments_url":"https://api.github.com/repos/eungyu/paragraph/comments{/number}","issue_comment_url":"https://api.github.com/repos/eungyu/paragraph/issues/comments{/number}","contents_url":"https://api.github.com/repos/eungyu/paragraph/contents/{+path}","compare_url":"https://api.github.com/repos/eungyu/paragraph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eungyu/paragraph/merges","archive_url":"https://api.github.com/repos/eungyu/paragraph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eungyu/paragraph/downloads","issues_url":"https://api.github.com/repos/eungyu/paragraph/issues{/number}","pulls_url":"https://api.github.com/repos/eungyu/paragraph/pulls{/number}","milestones_url":"https://api.github.com/repos/eungyu/paragraph/milestones{/number}","notifications_url":"https://api.github.com/repos/eungyu/paragraph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eungyu/paragraph/labels{/name}","releases_url":"https://api.github.com/repos/eungyu/paragraph/releases{/id}","created_at":"2014-12-03T05:37:44Z","updated_at":"2015-03-11T16:39:28Z","pushed_at":"2015-05-27T07:07:24Z","git_url":"git://github.com/eungyu/paragraph.git","ssh_url":"git@github.com:eungyu/paragraph.git","clone_url":"https://github.com/eungyu/paragraph.git","svn_url":"https://github.com/eungyu/paragraph","homepage":null,"size":788,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eungyu/paragraph/pulls/46"},"html":{"href":"https://github.com/eungyu/paragraph/pull/46"},"issue":{"href":"https://api.github.com/repos/eungyu/paragraph/issues/46"},"comments":{"href":"https://api.github.com/repos/eungyu/paragraph/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/eungyu/paragraph/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/eungyu/paragraph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eungyu/paragraph/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/eungyu/paragraph/statuses/682cec577579ecec71dcddd0f340e80db56caf02"}}}}