BigBrotherBot v1.9.0
System Development Information for the BigBrotherBot project.

b3::lib::elementtree::SimpleXMLWriter::XMLWriter Class Reference

XML writer class. More...

List of all members.

Public Member Functions

def __init__
def declaration
 Writes an XML declaration.
def start
 Opens a new element.
def comment
 Adds a comment to the output stream.
def data
 Adds character data to the output stream.
def end
 Closes the current element (opened by the most recent call to start).
def close
 Closes open elements, up to (and including) the element identified by the given identifier.
def element
 Adds an entire element.
def flush
 Flushes the output stream.

Public Attributes

 flush

Private Member Functions

def __flush

Private Attributes

 __write
 __open
 __tags
 __data
 __encoding

Detailed Description

XML writer class.

Parameters:
fileA file or file-like object. This object must implement a write method that takes an 8-bit string.
encodingOptional encoding.

Constructor & Destructor Documentation

def b3::lib::elementtree::SimpleXMLWriter::XMLWriter::__init__ (   self,
  file,
  encoding = "us-ascii" 
)

Member Function Documentation

def b3::lib::elementtree::SimpleXMLWriter::XMLWriter::__flush (   self) [private]
def b3::lib::elementtree::SimpleXMLWriter::XMLWriter::close (   self,
  id 
)

Closes open elements, up to (and including) the element identified by the given identifier.

Parameters:
idElement identifier, as returned by the start method.
def b3::lib::elementtree::SimpleXMLWriter::XMLWriter::comment (   self,
  comment 
)

Adds a comment to the output stream.

Parameters:
commentComment text, as an 8-bit string or Unicode string.
def b3::lib::elementtree::SimpleXMLWriter::XMLWriter::data (   self,
  text 
)

Adds character data to the output stream.

Parameters:
textCharacter data, as an 8-bit string or Unicode string.
def b3::lib::elementtree::SimpleXMLWriter::XMLWriter::declaration (   self)

Writes an XML declaration.

def b3::lib::elementtree::SimpleXMLWriter::XMLWriter::element (   self,
  tag,
  text = None,
  attrib = {},
  extra 
)

Adds an entire element.

This is the same as calling start, data, and end in sequence. The text argument can be omitted.

def b3::lib::elementtree::SimpleXMLWriter::XMLWriter::end (   self,
  tag = None 
)

Closes the current element (opened by the most recent call to start).

Parameters:
tagElement tag. If given, the tag must match the start tag. If omitted, the current element is closed.

Flushes the output stream.

def b3::lib::elementtree::SimpleXMLWriter::XMLWriter::start (   self,
  tag,
  attrib = {},
  extra 
)

Opens a new element.

Attributes can be given as keyword arguments, or as a string/string dictionary. You can pass in 8-bit strings or Unicode strings; the former are assumed to use the encoding passed to the constructor. The method returns an opaque identifier that can be passed to the close method, to close all open elements up to and including this one.

Parameters:
tagElement tag.
attribAttribute dictionary. Alternatively, attributes can be given as keyword arguments.
Returns:
An element identifier.

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Properties