|
| | trim_left (self, length, start=0, end=sys.maxsize) |
| |
| | get_text_block (self, start, flush_left=False) |
| |
| | get_indented (self, start=0, until_blank=False, strip_indent=True, block_indent=None, first_indent=None) |
| |
|
| get_2D_block (self, top, left, bottom, right, strip_indent=True) |
| |
| | pad_double_width (self, pad_char) |
| |
| | replace (self, old, new) |
| |
|
| __init__ (self, initlist=None, source=None, items=None, parent=None, parent_offset=None) |
| |
|
| __str__ (self) |
| |
|
| __repr__ (self) |
| |
|
| __lt__ (self, other) |
| |
|
| __le__ (self, other) |
| |
|
| __eq__ (self, other) |
| |
|
| __ne__ (self, other) |
| |
|
| __gt__ (self, other) |
| |
|
| __ge__ (self, other) |
| |
|
| __contains__ (self, item) |
| |
|
| __len__ (self) |
| |
|
| __getitem__ (self, i) |
| |
|
| __setitem__ (self, i, item) |
| |
|
| __delitem__ (self, i) |
| |
|
| __add__ (self, other) |
| |
|
| __radd__ (self, other) |
| |
|
| __iadd__ (self, other) |
| |
|
| __mul__ (self, n) |
| |
|
| __imul__ (self, n) |
| |
|
| extend (self, other) |
| |
|
| append (self, item, source=None, offset=0) |
| |
|
| insert (self, i, item, source=None, offset=0) |
| |
|
| pop (self, i=-1) |
| |
| | trim_start (self, n=1) |
| |
| | trim_end (self, n=1) |
| |
|
| remove (self, item) |
| |
|
| count (self, item) |
| |
|
| index (self, item) |
| |
|
| reverse (self) |
| |
|
| sort (self, *args) |
| |
| | info (self, i) |
| |
| | source (self, i) |
| |
| | offset (self, i) |
| |
| | disconnect (self) |
| |
| | xitems (self) |
| |
| | pprint (self) |
| |
A `ViewList` with string-specific methods.
| docutils.statemachine.StringList.get_indented |
( |
|
self, |
|
|
|
start = 0, |
|
|
|
until_blank = False, |
|
|
|
strip_indent = True, |
|
|
|
block_indent = None, |
|
|
|
first_indent = None |
|
) |
| |
Extract and return a StringList of indented lines of text.
Collect all lines with indentation, determine the minimum indentation,
remove the minimum indentation from all indented lines (unless
`strip_indent` is false), and return them. All lines up to but not
including the first unindented line will be returned.
:Parameters:
- `start`: The index of the first line to examine.
- `until_blank`: Stop collecting at the first blank line if true.
- `strip_indent`: Strip common leading indent if true (default).
- `block_indent`: The indent of the entire block, if known.
- `first_indent`: The indent of the first line, if known.
:Return:
- a StringList of indented lines with minimum indent removed;
- the amount of the indent;
- a boolean: did the indented block finish with a blank line or EOF?