App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Functions | Variables
google.appengine._internal.django.core.files.locks Namespace Reference

Functions

def fd
 
def lock
 
def unlock
 

Variables

tuple __all__ = ('LOCK_EX','LOCK_SH','LOCK_NB','lock','unlock')
 
 system_type = None
 
 LOCK_EX = win32con.LOCKFILE_EXCLUSIVE_LOCK
 
int LOCK_SH = 0
 
 LOCK_NB = win32con.LOCKFILE_FAIL_IMMEDIATELY
 
tuple __overlapped = pywintypes.OVERLAPPED()
 

Detailed Description

Portable file locking utilities.

Based partially on example by Jonathan Feignberg <jdf@pobox.com> in the Python
Cookbook, licensed under the Python Software License.

    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203

Example Usage::

    >>> from google.appengine._internal.django.core.files import locks
    >>> f = open('./file', 'wb')
    >>> locks.lock(f, locks.LOCK_EX)
    >>> f.write('Django')
    >>> f.close()

Function Documentation

def google.appengine._internal.django.core.files.locks.fd (   f)
Get a filedescriptor from something which could be a file or an fd.