pdk.XmlStream ($$)
index
pdk/XmlStream.py

Stream-like objects for reading/writing XML.

FOG 10/2000

 
Classes
            
_Stream
_XmlStream
FileXmlStream
ShelfXmlStream
URIXmlStream
StringXmlStream
 
class FileXmlStream(_XmlStream)
     
Purpose:exposes an XML file with a stream-like interface

 
  
Method resolution order:
FileXmlStream
_XmlStream
_Stream

Methods defined here:
mtime(self)
reopen(self)
reset(self)
 
class ShelfXmlStream(FileXmlStream)
     
Purpose:a stream-like object for manipulating a compound key shelf file that logs key modification times TreeShelf
Detail:provides a mechanism for reading/writing to a shelf file "behind the scenes". The source argument to the constructor is a tuple (shelf file name, shelf key tuple), where shelf key tuple is a tuple of strings as required by the CompoundKeyShelf base class. Note that the .read method is inherited from the _Stream class.

 
  
Method resolution order:
ShelfXmlStream
FileXmlStream
_XmlStream
_Stream

Methods defined here:
__init__(self, source, **optionD)
mtime(self)
revert(self)
 
class StringXmlStream(_XmlStream)
     
Purpose:exposes a plain XML string with a stream-like interface

 
  
Method resolution order:
StringXmlStream
_XmlStream
_Stream

Methods defined here:
__init__(self, source, flags='r', **optionD)
mtime(self)
reopen(self)
reset(self)
 
class URIXmlStream(FileXmlStream)
     
Purpose:an XML stream-like object based on a URI
Todo:check out possibilities to write to a URI

 
  
Method resolution order:
URIXmlStream
FileXmlStream
_XmlStream
_Stream

Methods defined here:
mtime(self)
reopen(self, bufsize=None)
reset = reopen(self, bufsize=None)
write(self, xmlString)
 
class _XmlStream(_Stream)
     
Purpose:a stream-like object for reading/writing XML strings

 
   Methods defined here:
getXmlHeader(self)
setXmlHeader(self, xmlString)
 
Functions
            
prepare_xml_stream(source, flags='w')
Purpose:factory function for finding the right wrapper for an XML stream source
Detail:if source is a string, we assume a file name; if it is a list or a tuple, we assume a composed shelf key. For all other input, an error is raised.
 
Author
            
$$