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`.`web`.`util`.`_SourceFragmentElement``

class documentation

`class _SourceFragmentElement(Element): (source)`

View In Hierarchy

`_SourceFragmentElement` is an `IRenderable` which can render several lines of source code near the line number of a particular frame object.

Method | `__init__` | Undocumented
Method | `sourceLines` | Render the source line indicated by `self.frame` and several surrounding lines. The active line will be given a class of `"snippetHighlightLine"`. Other lines will be given a class of `"snippetLine"`.
Instance Variable | `frame` | A `Failure`-style frame object for which to load a source line to render. This is really a tuple holding some information from a frame object. See `Failure.frames` for specifics.
Method | `_getSourceLines` | Find the source line references by `self.frame` and yield, in source line order, it and the previous and following lines.

Inherited from `Element`:

Method | `lookupRenderMethod` | Look up and return the named render method.
Method | `render` | Implement `IRenderable` to allow one `Element` to be embedded in another's template or rendering output.
Instance Variable | `loader` | The factory which will be used to load documents to return from `render`.

def __init__(self, loader, frame): (source)
overrides `twisted.web.template.Element.__init__`

Undocumented

@renderer
def sourceLines(self, request, tag): (source)

Render the source line indicated by `self.frame` and several surrounding lines. The active line will be given a class of `"snippetHighlightLine"`. Other lines will be given a class of `"snippetLine"`.

frame = (source)

A `Failure`-style frame object for which to load a source line to render. This is really a tuple holding some information from a frame object. See `Failure.frames` for specifics.

def _getSourceLines(self): (source)

Find the source line references by `self.frame` and yield, in source line order, it and the previous and following lines.

Returns
A generator which yields two-tuples. Each tuple gives a source line number and the contents of that source line.