Module b.rio

Part of bzrlib

No module docstring
Line # Kind Name Docs
40 Class RioWriter Undocumented
52 Class RioReader Read stanzas from a file as a sequence
70 Function rio_file Produce a rio IterableFile from an iterable of stanzas
85 Function read_stanzas Undocumented
93 Class Stanza One stanza for rio.
240 Function valid_tag Undocumented
244 Function read_stanza Return new Stanza read from list of lines or a file
261 Function read_stanza_unicode Read a Stanza from a list of lines or a file.
316 Function to_patch_lines Convert a stanza into RIO-Patch format lines.
392 Function read_patch_stanza Convert an iterable of RIO-Patch format lines into a Stanza.
362 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 BzrLib, generated by pydoctor at 2008-12-03 00:00:12.