OLD | NEW |
1 # Copyright 2011 Google Inc. | 1 # Copyright 2011 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, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 __author__ = 'jbeda@google.com (Joe Beda)' | 44 __author__ = 'jbeda@google.com (Joe Beda)' |
45 | 45 |
46 import base64 | 46 import base64 |
47 import errno | 47 import errno |
48 import logging | 48 import logging |
49 import os | 49 import os |
50 import threading | 50 import threading |
51 | 51 |
52 from anyjson import simplejson | 52 from anyjson import simplejson |
53 from oauth2client.client import Storage as BaseStorage | 53 from .client import Storage as BaseStorage |
54 from oauth2client.client import Credentials | 54 from .client import Credentials |
55 from oauth2client import util | 55 from . import util |
56 from locked_file import LockedFile | 56 from locked_file import LockedFile |
57 | 57 |
58 logger = logging.getLogger(__name__) | 58 logger = logging.getLogger(__name__) |
59 | 59 |
60 # A dict from 'filename'->_MultiStore instances | 60 # A dict from 'filename'->_MultiStore instances |
61 _multistores = {} | 61 _multistores = {} |
62 _multistores_lock = threading.Lock() | 62 _multistores_lock = threading.Lock() |
63 | 63 |
64 | 64 |
65 class Error(Exception): | 65 class Error(Exception): |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 | 456 |
457 This Storage is a 'view' into the multistore. | 457 This Storage is a 'view' into the multistore. |
458 | 458 |
459 Args: | 459 Args: |
460 key: The key used to retrieve the credential | 460 key: The key used to retrieve the credential |
461 | 461 |
462 Returns: | 462 Returns: |
463 A Storage object that can be used to get/set this cred | 463 A Storage object that can be used to get/set this cred |
464 """ | 464 """ |
465 return self._Storage(self, key) | 465 return self._Storage(self, key) |
OLD | NEW |