Part of bzrlib
Class | RioWriter | Undocumented |
Class | RioReader | Read stanzas from a file as a sequence |
Function | rio_file | Produce a rio IterableFile from an iterable of stanzas |
Function | read_stanzas | Undocumented |
Class | Stanza | One stanza for rio. |
Function | valid_tag | Undocumented |
Function | read_stanza | Return new Stanza read from list of lines or a file |
Function | read_stanza_unicode | Read a Stanza from a list of lines or a file. |
Function | to_patch_lines | Convert a stanza into RIO-Patch format lines. |
Function | read_patch_stanza | Convert an iterable of RIO-Patch format lines into a Stanza. |
Function | _patch_stanza_iter | Undocumented |
Returns one Stanza that was read, or returns None at end of file. If a blank line follows the stanza, it is consumed. It's not an error for there to be no blank at end of file. If there is a blank file at the start of the input this is really an empty stanza and that is returned.
Only the stanza lines and the trailing blank (if any) are consumed from the line_iter.
The raw lines must be in utf-8 encoding.
The lines should already be in unicode form. This returns a single stanza that was read. If there is a blank line at the end of the Stanza, it is consumed. It is not an error for there to be no blank line at the end of the iterable. If there is a blank line at the beginning, this is treated as an empty Stanza and None is returned.
Only the stanza lines and the trailing blank (if any) are consumed from the unicode_iter
Parameters | unicode_iter | A iterable, yeilding Unicode strings. See read_stanza if you have a utf-8 encoded string. |
Returns | A Stanza object if there are any lines in the file. None otherwise |
RIO-Patch is a RIO variant designed to be e-mailed as part of a patch. It resists common forms of damage such as newline conversion or the removal of trailing whitespace, yet is also reasonably easy to read.
Parameters | max_width | The maximum number of characters per physical line. |
Returns | a list of lines |
RIO-Patch is a RIO variant designed to be e-mailed as part of a patch. It resists common forms of damage such as newline conversion or the removal of trailing whitespace, yet is also reasonably easy to read.
Returns | a Stanza |