{"action":"created","comment":{"url":"https://api.github.com/repos/google/oauth2client/pulls/comments/45918203","id":45918203,"diff_hunk":"@@ -0,0 +1,55 @@\n+# Copyright 2014 Google Inc. All rights reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#      http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+\"\"\"Lock-safe storage for OAuth2 Credentials.\n+\n+This module provides the LockStorage base class that is used to provide\n+optional lock safety to Storage sub-classes.\n+\"\"\"\n+\n+import os\n+import threading\n+\n+from oauth2client.client import Storage as Storage\n+\n+\n+__author__ = 'jonwayne@google.com (Jon Wayne Parrott)'\n+\n+\n+class LockedStorage(Storage):\n+    \"\"\"Storage base class that provides optional locking.\"\"\"\n+\n+    def __init__(self, lock=None):\n+        \"\"\"Create a LockedStorage instance.\n+\n+        Args:\n+            lock: An optional threading.Lock-like object. Must implement at\n+                  least acquire() and release(). Does not need to be re-entrant.\n+        \"\"\"\n+        self._lock = lock\n+\n+    def acquire_lock(self):\n+        \"\"\"Acquires any lock necessary to access this storage.","path":"oauth2client/locked_storage.py","position":null,"original_position":43,"commit_id":"65152b8211de2b88e9171670243e8293590919e3","original_commit_id":"2dc48153c11b15aaa63ae716f0009d36f38a57f7","user":{"login":"jonparrott","id":250995,"avatar_url":"https://avatars.githubusercontent.com/u/250995?v=3","gravatar_id":"","url":"https://api.github.com/users/jonparrott","html_url":"https://github.com/jonparrott","followers_url":"https://api.github.com/users/jonparrott/followers","following_url":"https://api.github.com/users/jonparrott/following{/other_user}","gists_url":"https://api.github.com/users/jonparrott/gists{/gist_id}","starred_url":"https://api.github.com/users/jonparrott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonparrott/subscriptions","organizations_url":"https://api.github.com/users/jonparrott/orgs","repos_url":"https://api.github.com/users/jonparrott/repos","events_url":"https://api.github.com/users/jonparrott/events{/privacy}","received_events_url":"https://api.github.com/users/jonparrott/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-11-25T20:58:03Z","updated_at":"2015-11-25T20:58:03Z","html_url":"https://github.com/google/oauth2client/pull/344#discussion_r45918203","pull_request_url":"https://api.github.com/repos/google/oauth2client/pulls/344","_links":{"self":{"href":"https://api.github.com/repos/google/oauth2client/pulls/comments/45918203"},"html":{"href":"https://github.com/google/oauth2client/pull/344#discussion_r45918203"},"pull_request":{"href":"https://api.github.com/repos/google/oauth2client/pulls/344"}}},"pull_request":{"url":"https://api.github.com/repos/google/oauth2client/pulls/344","id":51721585,"html_url":"https://github.com/google/oauth2client/pull/344","diff_url":"https://github.com/google/oauth2client/pull/344.diff","patch_url":"https://github.com/google/oauth2client/pull/344.patch","issue_url":"https://api.github.com/repos/google/oauth2client/issues/344","number":344,"state":"open","locked":false,"title":"Add two new storage classes for #319.","user":{"login":"jonparrott","id":250995,"avatar_url":"https://avatars.githubusercontent.com/u/250995?v=3","gravatar_id":"","url":"https://api.github.com/users/jonparrott","html_url":"https://github.com/jonparrott","followers_url":"https://api.github.com/users/jonparrott/followers","following_url":"https://api.github.com/users/jonparrott/following{/other_user}","gists_url":"https://api.github.com/users/jonparrott/gists{/gist_id}","starred_url":"https://api.github.com/users/jonparrott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonparrott/subscriptions","organizations_url":"https://api.github.com/users/jonparrott/orgs","repos_url":"https://api.github.com/users/jonparrott/repos","events_url":"https://api.github.com/users/jonparrott/events{/privacy}","received_events_url":"https://api.github.com/users/jonparrott/received_events","type":"User","site_admin":false},"body":"* LockedStorage - implements a generic storage base class that uses a `threading.Lock` like-object.\r\n* DictionaryStorage - implements an optionally-locked storage over a dictionary-like object.\r\n\r\nAdditionally:\r\n* Updated `file.Storage` to use `LockedStorage`.\r\n* Remove `flask_util.FlaskSessionStorage` and replaced it with `DictionaryStorage`.","created_at":"2015-11-24T21:45:16Z","updated_at":"2015-11-25T20:58:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c56fba35955279b50a787b911893da773a57e0f4","assignee":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/google/oauth2client/pulls/344/commits","review_comments_url":"https://api.github.com/repos/google/oauth2client/pulls/344/comments","review_comment_url":"https://api.github.com/repos/google/oauth2client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/oauth2client/issues/344/comments","statuses_url":"https://api.github.com/repos/google/oauth2client/statuses/65152b8211de2b88e9171670243e8293590919e3","head":{"label":"jonparrott:dictionary-storage","ref":"dictionary-storage","sha":"65152b8211de2b88e9171670243e8293590919e3","user":{"login":"jonparrott","id":250995,"avatar_url":"https://avatars.githubusercontent.com/u/250995?v=3","gravatar_id":"","url":"https://api.github.com/users/jonparrott","html_url":"https://github.com/jonparrott","followers_url":"https://api.github.com/users/jonparrott/followers","following_url":"https://api.github.com/users/jonparrott/following{/other_user}","gists_url":"https://api.github.com/users/jonparrott/gists{/gist_id}","starred_url":"https://api.github.com/users/jonparrott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonparrott/subscriptions","organizations_url":"https://api.github.com/users/jonparrott/orgs","repos_url":"https://api.github.com/users/jonparrott/repos","events_url":"https://api.github.com/users/jonparrott/events{/privacy}","received_events_url":"https://api.github.com/users/jonparrott/received_events","type":"User","site_admin":false},"repo":{"id":35853207,"name":"oauth2client","full_name":"jonparrott/oauth2client","owner":{"login":"jonparrott","id":250995,"avatar_url":"https://avatars.githubusercontent.com/u/250995?v=3","gravatar_id":"","url":"https://api.github.com/users/jonparrott","html_url":"https://github.com/jonparrott","followers_url":"https://api.github.com/users/jonparrott/followers","following_url":"https://api.github.com/users/jonparrott/following{/other_user}","gists_url":"https://api.github.com/users/jonparrott/gists{/gist_id}","starred_url":"https://api.github.com/users/jonparrott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonparrott/subscriptions","organizations_url":"https://api.github.com/users/jonparrott/orgs","repos_url":"https://api.github.com/users/jonparrott/repos","events_url":"https://api.github.com/users/jonparrott/events{/privacy}","received_events_url":"https://api.github.com/users/jonparrott/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jonparrott/oauth2client","description":"This is a python library for accessing resources protected by OAuth 2.0.","fork":true,"url":"https://api.github.com/repos/jonparrott/oauth2client","forks_url":"https://api.github.com/repos/jonparrott/oauth2client/forks","keys_url":"https://api.github.com/repos/jonparrott/oauth2client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonparrott/oauth2client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonparrott/oauth2client/teams","hooks_url":"https://api.github.com/repos/jonparrott/oauth2client/hooks","issue_events_url":"https://api.github.com/repos/jonparrott/oauth2client/issues/events{/number}","events_url":"https://api.github.com/repos/jonparrott/oauth2client/events","assignees_url":"https://api.github.com/repos/jonparrott/oauth2client/assignees{/user}","branches_url":"https://api.github.com/repos/jonparrott/oauth2client/branches{/branch}","tags_url":"https://api.github.com/repos/jonparrott/oauth2client/tags","blobs_url":"https://api.github.com/repos/jonparrott/oauth2client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonparrott/oauth2client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonparrott/oauth2client/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonparrott/oauth2client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonparrott/oauth2client/statuses/{sha}","languages_url":"https://api.github.com/repos/jonparrott/oauth2client/languages","stargazers_url":"https://api.github.com/repos/jonparrott/oauth2client/stargazers","contributors_url":"https://api.github.com/repos/jonparrott/oauth2client/contributors","subscribers_url":"https://api.github.com/repos/jonparrott/oauth2client/subscribers","subscription_url":"https://api.github.com/repos/jonparrott/oauth2client/subscription","commits_url":"https://api.github.com/repos/jonparrott/oauth2client/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonparrott/oauth2client/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonparrott/oauth2client/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonparrott/oauth2client/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonparrott/oauth2client/contents/{+path}","compare_url":"https://api.github.com/repos/jonparrott/oauth2client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonparrott/oauth2client/merges","archive_url":"https://api.github.com/repos/jonparrott/oauth2client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonparrott/oauth2client/downloads","issues_url":"https://api.github.com/repos/jonparrott/oauth2client/issues{/number}","pulls_url":"https://api.github.com/repos/jonparrott/oauth2client/pulls{/number}","milestones_url":"https://api.github.com/repos/jonparrott/oauth2client/milestones{/number}","notifications_url":"https://api.github.com/repos/jonparrott/oauth2client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonparrott/oauth2client/labels{/name}","releases_url":"https://api.github.com/repos/jonparrott/oauth2client/releases{/id}","created_at":"2015-05-19T01:57:46Z","updated_at":"2015-05-19T01:57:47Z","pushed_at":"2015-11-25T20:57:53Z","git_url":"git://github.com/jonparrott/oauth2client.git","ssh_url":"git@github.com:jonparrott/oauth2client.git","clone_url":"https://github.com/jonparrott/oauth2client.git","svn_url":"https://github.com/jonparrott/oauth2client","homepage":"","size":22785,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"4cf98dc4c4988b9a30d236802f1ae4289f1e631f","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":14211461,"name":"oauth2client","full_name":"google/oauth2client","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/oauth2client","description":"This is a Python library for accessing resources protected by OAuth 2.0.","fork":false,"url":"https://api.github.com/repos/google/oauth2client","forks_url":"https://api.github.com/repos/google/oauth2client/forks","keys_url":"https://api.github.com/repos/google/oauth2client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/oauth2client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/oauth2client/teams","hooks_url":"https://api.github.com/repos/google/oauth2client/hooks","issue_events_url":"https://api.github.com/repos/google/oauth2client/issues/events{/number}","events_url":"https://api.github.com/repos/google/oauth2client/events","assignees_url":"https://api.github.com/repos/google/oauth2client/assignees{/user}","branches_url":"https://api.github.com/repos/google/oauth2client/branches{/branch}","tags_url":"https://api.github.com/repos/google/oauth2client/tags","blobs_url":"https://api.github.com/repos/google/oauth2client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/oauth2client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/oauth2client/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/oauth2client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/oauth2client/statuses/{sha}","languages_url":"https://api.github.com/repos/google/oauth2client/languages","stargazers_url":"https://api.github.com/repos/google/oauth2client/stargazers","contributors_url":"https://api.github.com/repos/google/oauth2client/contributors","subscribers_url":"https://api.github.com/repos/google/oauth2client/subscribers","subscription_url":"https://api.github.com/repos/google/oauth2client/subscription","commits_url":"https://api.github.com/repos/google/oauth2client/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/oauth2client/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/oauth2client/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/oauth2client/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/oauth2client/contents/{+path}","compare_url":"https://api.github.com/repos/google/oauth2client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/oauth2client/merges","archive_url":"https://api.github.com/repos/google/oauth2client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/oauth2client/downloads","issues_url":"https://api.github.com/repos/google/oauth2client/issues{/number}","pulls_url":"https://api.github.com/repos/google/oauth2client/pulls{/number}","milestones_url":"https://api.github.com/repos/google/oauth2client/milestones{/number}","notifications_url":"https://api.github.com/repos/google/oauth2client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/oauth2client/labels{/name}","releases_url":"https://api.github.com/repos/google/oauth2client/releases{/id}","created_at":"2013-11-07T18:03:04Z","updated_at":"2015-11-25T03:30:10Z","pushed_at":"2015-11-25T20:57:54Z","git_url":"git://github.com/google/oauth2client.git","ssh_url":"git@github.com:google/oauth2client.git","clone_url":"https://github.com/google/oauth2client.git","svn_url":"https://github.com/google/oauth2client","homepage":"","size":23444,"stargazers_count":282,"watchers_count":282,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":141,"mirror_url":null,"open_issues_count":58,"forks":141,"open_issues":58,"watchers":282,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/oauth2client/pulls/344"},"html":{"href":"https://github.com/google/oauth2client/pull/344"},"issue":{"href":"https://api.github.com/repos/google/oauth2client/issues/344"},"comments":{"href":"https://api.github.com/repos/google/oauth2client/issues/344/comments"},"review_comments":{"href":"https://api.github.com/repos/google/oauth2client/pulls/344/comments"},"review_comment":{"href":"https://api.github.com/repos/google/oauth2client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/oauth2client/pulls/344/commits"},"statuses":{"href":"https://api.github.com/repos/google/oauth2client/statuses/65152b8211de2b88e9171670243e8293590919e3"}}}}