Package oauth2client :: Module file :: Class Storage |
[hide private]
[frames] | no frames]

# Class Storage

source code

    Store and retrieve a single credential to and from a file.

Instance Methods | [hide private]
__init__(self, filename) x.__init__(...) initializes x; see help(type(x)) for signature | source code
_validate_file(self) | source code
acquire_lock(self) Acquires any lock necessary to access this Storage. | source code
release_lock(self) Release the Storage lock. | source code
locked_get(self) Retrieve Credential from file. | source code
_create_file_if_needed(self) Create an empty file if necessary. | source code
locked_put(self, credentials) Write Credentials to file. | source code
locked_delete(self) Delete Credentials file. | source code
Inherited from `client.Storage`: `delete`, `get`, `put` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, filename) (Constructor) | source code
    x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__ (inherited documentation)

### acquire_lock(self) | source code
    Acquires any lock necessary to access this Storage.

    This lock is not reentrant.
Overrides: client.Storage.acquire_lock

### release_lock(self) | source code
    Release the Storage lock.

    Trying to release a lock that isn't held will result in a
    RuntimeError.
Overrides: client.Storage.release_lock

### locked_get(self) | source code
    Retrieve Credential from file.

    Returns:
      oauth2client.client.Credentials

    Raises:
      CredentialsFileSymbolicLinkError if the file is a symbolic link.
Overrides: client.Storage.locked_get

### _create_file_if_needed(self) | source code
    Create an empty file if necessary.

    This method will not initialize the file. Instead it implements a
    simple version of "touch" to ensure the file has been created.

### locked_put(self, credentials) | source code
    Write Credentials to file.

    Args:
      credentials: Credentials, the credentials to store.

    Raises:
      CredentialsFileSymbolicLinkError if the file is a symbolic link.
Overrides: client.Storage.locked_put

### locked_delete(self) | source code
    Delete Credentials file.

    Args:
      credentials: Credentials, the credentials to store.
Overrides: client.Storage.locked_delete