Part of bzrlib.rio View In Hierarchy
Each stanza contains a set of named fields.
Names must be non-empty ascii alphanumeric plus _. Names can be repeated within a stanza. Names are case-sensitive. The ordering of fields is preserved.
Each field value must be either an int or a string.
Method | __init__ | Construct a new Stanza. |
Method | add | Append a name and value to the stanza. |
Class Method | from_pairs | Undocumented |
Method | __contains__ | True if there is any field in this stanza with the given tag. |
Method | __len__ | Return number of pairs in the stanza. |
Method | __eq__ | Undocumented |
Method | __ne__ | Undocumented |
Method | __repr__ | Undocumented |
Method | iter_pairs | Return iterator of tag, value pairs. |
Method | to_lines | Generate sequence of lines for external version of this file. |
Method | to_string | Return stanza as a single string |
Method | to_unicode | Return stanza as a single Unicode string. |
Method | write | Write stanza to a file |
Method | get | Return the value for a field wih given tag. |
Method | get_all | Undocumented |
Method | as_dict | Return a dict containing the unique values of the stanza. |
The keyword arguments, if any, are added in sorted order to the stanza.
The lines are always utf-8 encoded strings.
This is most useful when adding a Stanza to a parent Stanza