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`.`usage``

module documentation
(source)

twisted.python.usage is a module for parsing/handling the command line of your program.

For information on how to use it, see http://twistedmatrix.com/projects/core/documentation/howto/options.html, or doc/core/howto/options.xhtml in your Twisted directory.

Class | `CoerceParameter` | Utility class that can corce a parameter before storing it.
Class | `CompleteDirs` | Completes directory names
Class | `CompleteFiles` | Completes file names based on a glob pattern
Class | `CompleteGroups` | Complete system group names
Class | `CompleteHostnames` | Complete hostnames
Class | `CompleteList` | Completes based on a fixed list of words
Class | `CompleteMultiList` | Completes multiple comma-separated items based on a fixed list of words
Class | `CompleteNetInterfaces` | Complete network interface names
Class | `Completer` | A completion "action" - provides completion possibilities for a particular command-line option. For example we might provide the user a fixed list of choices, or files/dirs according to a glob.
Class | `CompleteUserAtHost` | A completion action which produces matches in any of these forms:
Class | `CompleteUsernames` | Complete usernames
Class | `Completions` | Extra metadata for the shell tab-completion system.
Class | `Options` | An option list parser class
Exception | `UsageError` | Undocumented
Function | `docMakeChunks` | Makes doc chunks for option declarations.
Function | `flagFunction` | Determine whether a function is an optional handler for a flag or an option.
Function | `portCoerce` | Coerce a string value to an int port number, and checks the validity.
Constant | `_BASH` | Undocumented
Constant | `_ZSH` | Undocumented

def docMakeChunks(optList, width=80): (source)

Makes doc chunks for option declarations.

Takes a list of dictionaries, each of which may have one or more of the keys 'long', 'short', 'doc', 'default', 'optType'.

Returns a list of strings. The strings may be multiple lines, all of them end with a newline.

def flagFunction(method, name=None): (source)

Determine whether a function is an optional handler for a flag or an option.

A flag handler takes no additional arguments. It is used to handle command-line arguments like --nodaemon.

An option handler takes one argument. It is used to handle command-line arguments like --path=/foo/bar.

Parameters
method | The bound method object to inspect.
name:`str` | The name of the option for which the function is a handle.
Returns
If the method is a flag handler, return `True`. Otherwise return `False`.
Raises
`UsageError` | If the method takes more than one argument.

def portCoerce(value): (source)

Coerce a string value to an int port number, and checks the validity.

_BASH: `str` = (source)

Undocumented

Value

    'bash'

_ZSH: `str` = (source)

Undocumented

Value

    'zsh'