Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`python`.`lockfile`.`FilesystemLock``

class documentation

`class FilesystemLock: (source)`

Known subclasses: `twisted.internet.defer.DeferredFilesystemLock`

Constructor: `FilesystemLock(name)`

View In Hierarchy

A mutex.

This relies on the filesystem property that creating a symlink is an atomic operation and that it will fail if the symlink already exists. Deleting the symlink will release the lock.

Method | `__init__` | Undocumented
Method | `lock` | Acquire this lock.
Method | `unlock` | Release this lock.
Instance Variable | `clean` | Indicates whether this lock was released cleanly by its last owner. Only meaningful after `lock` has been called and returns True.
Instance Variable | `locked` | Indicates whether the lock is currently held by this object.
Instance Variable | `name` | The name of the file associated with this lock.

def __init__(self, name): (source)
overridden in `twisted.internet.defer.DeferredFilesystemLock`

Undocumented

def lock(self): (source)

Acquire this lock.

Returns
`bool` | True if the lock is acquired, false otherwise.
Raises
`OSError` | Any exception `os.symlink()` may raise, other than `errno.EEXIST`.

def unlock(self): (source)

Release this lock.

This deletes the directory with the given name.

Raises
`OSError` | Any exception `os.readlink()` may raise.
`ValueError` | If the lock is not owned by this process.

clean = (source)

Indicates whether this lock was released cleanly by its last owner. Only meaningful after `lock` has been called and returns True.

locked: `bool` = (source)

Indicates whether the lock is currently held by this object.

name = (source)

The name of the file associated with this lock.