class Input(TransformSpec): (source)
Known subclasses: docutils.io.DocTreeInput
, docutils.io.FileInput
, docutils.io.NullInput
, docutils.io.StringInput
Abstract base class for input wrappers.
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | decode |
Decode `data` if required. |
Method | determine |
Try to determine the encoding of `data` by looking *in* `data`. Check for a byte order mark (BOM) or an encoding declaration. |
Method | isatty |
Undocumented |
Method | read |
Undocumented |
Class Variable | byte |
Sequence of (start_bytes, encoding) tuples for encoding detection. The first bytes of input data are checked against the start_bytes strings. A match indicates the given encoding. |
Class Variable | coding |
Encoding declaration pattern. |
Class Variable | component |
Undocumented |
Class Variable | default |
Undocumented |
Instance Variable | encoding |
Text encoding for the input source. |
Instance Variable | error |
Text decoding error handler. |
Instance Variable | source |
The source of input data. |
Instance Variable | source |
A text reference to the source. |
Instance Variable | successful |
The encoding that successfully decoded the source data. |
Inherited from TransformSpec
:
Method | get |
Transforms required by this class. Override in subclasses. |
Class Variable | default |
Undocumented |
Class Variable | unknown |
List of functions to try to resolve unknown references. Unknown references have a 'refname' attribute which doesn't correspond to any target in the document. Called when the transforms in `docutils.transforms... |
Decode `data` if required. Return Unicode `str` instances unchanged (nothing to decode). If `self.encoding` is None, determine encoding from data or try UTF-8, locale encoding, and (as last ressort) 'latin-1'. The client application should call ``locale.setlocale`` at the beginning of processing:: locale.setlocale(locale.LC_ALL, '') Raise UnicodeError if unsuccessful.
Try to determine the encoding of `data` by looking *in* `data`. Check for a byte order mark (BOM) or an encoding declaration.
docutils.io.DocTreeInput
, docutils.io.FileInput
, docutils.io.NullInput
, docutils.io.StringInput
Undocumented
Sequence of (start_bytes, encoding) tuples for encoding detection. The first bytes of input data are checked against the start_bytes strings. A match indicates the given encoding.