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

Class _FcntlOpener

source code


Open, lock, and unlock a file using fcntl.lockf.

Instance Methods [hide private]
 
open_and_lock(self, timeout, delay)
Open the file and lock it.
source code
 
unlock_and_close(self)
Close and unlock the file using the fcntl.lockf primitive.
source code

Inherited from _Opener: __init__, file_handle, filename, is_locked

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]

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

Raises:
  AlreadyLockedException: if the lock is already acquired.
  IOError: if the open fails.

Overrides: _Opener.open_and_lock

unlock_and_close(self)

source code 
Close and unlock the file using the fcntl.lockf primitive.

Overrides: _Opener.unlock_and_close