Input for single, simple file-like objects.
Method | __init__ |
:Parameters: - `source`: either a file-like object (which is read directly), or `None` (which implies `sys.stdin` if no `source_path` given). - `source_path`: a path to a file, which is opened and then read... |
Method | close |
Undocumented |
Method | read |
Read and decode a single file and return the data (Unicode string). |
Method | readlines |
Return lines of a single file as list of Unicode strings. |
Instance Variable | autoclose |
Undocumented |
Instance Variable | source |
The source of input data. |
Instance Variable | source |
A text reference to the source. |
Instance Variable | _stderr |
Undocumented |
Inherited from Input
:
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 |
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 | successful |
The encoding that successfully decoded the source data. |
Inherited from TransformSpec
(via Input
):
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... |
docutils.io.Input.__init__
:Parameters: - `source`: either a file-like object (which is read directly), or `None` (which implies `sys.stdin` if no `source_path` given). - `source_path`: a path to a file, which is opened and then read. - `encoding`: the expected text encoding of the input file. - `error_handler`: the encoding error handler to use. - `autoclose`: close automatically after read (except when `sys.stdin` is the source). - `mode`: how the file is to be opened (see standard function `open`). The default is read only ('r').
docutils.io.Input.read
Read and decode a single file and return the data (Unicode string).