b.rio : module documentation

Part of bzrlib

No module docstring
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
def rio_file(stanzas, header=None):
Produce a rio IterableFile from an iterable of stanzas
def read_stanzas(from_file):
Undocumented
def valid_tag(tag):
Undocumented
def read_stanza(line_iter):
Return new Stanza read from list of lines or a file

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.

def read_stanza_unicode(unicode_iter):
Read a Stanza from a list of lines or a file.

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

Parametersunicode_iterA iterable, yeilding Unicode strings. See read_stanza if you have a utf-8 encoded string.
ReturnsA Stanza object if there are any lines in the file. None otherwise
def to_patch_lines(stanza, max_width=72):
Convert a stanza into RIO-Patch format 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.

Parametersmax_widthThe maximum number of characters per physical line.
Returnsa list of lines
def _patch_stanza_iter(line_iter):
Undocumented
def read_patch_stanza(line_iter):
Convert an iterable of RIO-Patch format lines into a Stanza.

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.

Returnsa Stanza
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.