Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: third_party/oauth2client/keyring_storage.py

Issue 1094533003: Revert of Upgrade 3rd packages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/oauth2client/gce.py ('k') | third_party/oauth2client/locked_file.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 Google Inc. All rights reserved. 1 # Copyright (C) 2012 Google Inc.
2 # 2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); 3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License. 4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at 5 # You may obtain a copy of the License at
6 # 6 #
7 # http://www.apache.org/licenses/LICENSE-2.0 7 # http://www.apache.org/licenses/LICENSE-2.0
8 # 8 #
9 # Unless required by applicable law or agreed to in writing, software 9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, 10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and 12 # See the License for the specific language governing permissions and
13 # limitations under the License. 13 # limitations under the License.
14 14
15 """A keyring based Storage. 15 """A keyring based Storage.
16 16
17 A Storage for Credentials that uses the keyring module. 17 A Storage for Credentials that uses the keyring module.
18 """ 18 """
19 19
20 __author__ = 'jcgregorio@google.com (Joe Gregorio)' 20 __author__ = 'jcgregorio@google.com (Joe Gregorio)'
21 21
22 import keyring
22 import threading 23 import threading
23 24
24 import keyring 25 from client import Storage as BaseStorage
25
26 from client import Credentials 26 from client import Credentials
27 from client import Storage as BaseStorage
28 27
29 28
30 class Storage(BaseStorage): 29 class Storage(BaseStorage):
31 """Store and retrieve a single credential to and from the keyring. 30 """Store and retrieve a single credential to and from the keyring.
32 31
33 To use this module you must have the keyring module installed. See 32 To use this module you must have the keyring module installed. See
34 <http://pypi.python.org/pypi/keyring/>. This is an optional module and is not 33 <http://pypi.python.org/pypi/keyring/>. This is an optional module and is not
35 installed with oauth2client by default because it does not work on all the 34 installed with oauth2client by default because it does not work on all the
36 platforms that oauth2client supports, such as Google App Engine. 35 platforms that oauth2client supports, such as Google App Engine.
37 36
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 """ 99 """
101 keyring.set_password(self._service_name, self._user_name, 100 keyring.set_password(self._service_name, self._user_name,
102 credentials.to_json()) 101 credentials.to_json())
103 102
104 def locked_delete(self): 103 def locked_delete(self):
105 """Delete Credentials file. 104 """Delete Credentials file.
106 105
107 Args: 106 Args:
108 credentials: Credentials, the credentials to store. 107 credentials: Credentials, the credentials to store.
109 """ 108 """
110 keyring.set_password(self._service_name, self._user_name, '') 109 keyring.set_password(self._service_name, self._user_name, '')
OLDNEW
« no previous file with comments | « third_party/oauth2client/gce.py ('k') | third_party/oauth2client/locked_file.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698