Package oauth2client :: Module locked_file :: Class _Opener |
[hide private]
[frames] | no frames]

# Class _Opener

source code

    Base class for different locking primitives.

Instance Methods | [hide private]
__init__(self, filename, mode, fallback_mode) Create an Opener. | source code
is_locked(self) Was the file locked. | source code
file_handle(self) The file handle to the file. | source code
filename(self) The filename that is being locked. | source code
open_and_lock(self, timeout, delay) Open the file and lock it. | source code
unlock_and_close(self) Unlock and close the file. | source code
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, mode, fallback_mode) (Constructor) | source code
    Create an Opener.

    Args:
      filename: string, The pathname of the file.
      mode: string, The preferred mode to access the file with.
      fallback_mode: string, The mode to use if locking fails.
Overrides: object.__init__

### file_handle(self) | source code
    The file handle to the file. Valid only after opened.

### open_and_lock(self, timeout, delay) | source code
    Open the file and lock it.

    Args:
      timeout: float, How long to try to lock for.
      delay: float, How long to wait between retries.