| |
- Propertied(object)
-
- XMLGenerator
- XMLReader
- XMLGenerator(ContentHandler)
-
- Generator
class Generator(XMLGenerator) |
|
Friendly generator for XML code |
|
- Method resolution order:
- Generator
- XMLGenerator
- ContentHandler
Methods defined here:
- __init__(self, out=None, encoding='utf-8')
- Initialise the generator
Just overrides the default encoding of the base-class
- startElement(self, name, attributes=None)
- Start a new element with given attributes
Methods inherited from XMLGenerator:
- characters(self, content)
- endElement(self, name)
- endElementNS(self, name, qname)
- endPrefixMapping(self, prefix)
- ignorableWhitespace(self, content)
- processingInstruction(self, target, data)
- startDocument(self)
- startElementNS(self, name, qname, attrs)
- startPrefixMapping(self, prefix, uri)
Methods inherited from ContentHandler:
- endDocument(self)
- Receive notification of the end of a document.
The SAX parser will invoke this method only once, and it will
be the last method invoked during the parse. The parser shall
not invoke this method until it has either abandoned parsing
(because of an unrecoverable error) or reached the end of
input.
- setDocumentLocator(self, locator)
- Called by the parser to give the application a locator for
locating the origin of document events.
SAX parsers are strongly encouraged (though not absolutely
required) to supply a locator: if it does so, it must supply
the locator to the application by invoking this method before
invoking any of the other methods in the DocumentHandler
interface.
The locator allows the application to determine the end
position of any document-related event, even if the parser is
not reporting an error. Typically, the application will use
this information for reporting its own errors (such as
character content that does not match an application's
business rules). The information returned by the locator is
probably not sufficient for use with a search engine.
Note that the locator will return correct information only
during the invocation of the events in this interface. The
application should not attempt to use it at any other time.
- skippedEntity(self, name)
- Receive notification of a skipped entity.
The Parser will invoke this method once for each entity
skipped. Non-validating processors may skip entities if they
have not seen the declarations (because, for example, the
entity was declared in an external DTD subset). All processors
may skip external entities, depending on the values of the
http://xml.org/sax/features/external-general-entities and the
http://xml.org/sax/features/external-parameter-entities
properties.
|
class XMLGenerator(Propertied) |
|
Base-class for XML-generating objects |
|
- Method resolution order:
- XMLGenerator
- Propertied
- object
Methods defined here:
- __call__(self, schema, *arguments, **named)
- Create XML document for given schema
- __init__(self, driver=None, **named)
- Initialise the statement-generator
Driver will be used to determine features for
generation (when that's implemented).
- node(self, schema, *arguments, **named)
- Generate XML for a single schema node
- simpleDataType(self, property, client=None, value=None)
- Is this property a simple data-type (can be included in an attr)?
- valueAsContent(self, value)
- Export given value as a piece of content
Data and other attributes defined here:
- propertyTagName = 'p'
Methods inherited from Propertied:
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data and other attributes inherited from Propertied:
- __dict__ = <dictproxy object at 0x01FE0B30>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Propertied' objects>
- list of weak references to the object (if defined)
|
class XMLReader(Propertied) |
|
Class to read in a database description |
|
- Method resolution order:
- XMLReader
- Propertied
- object
Methods defined here:
- __init__(self)
- characters(self, *args, **named)
- endDocument(self, *args, **named)
- endElement(self, name)
- node(self, name, properties)
- Create a new node given familiar name "name" and property-set
- processingInstruction(self, *args, **named)
- setDocumentLocator(self, *args, **named)
- startDocument(self, *args, **named)
- startElement(self, name, properties)
- Deal with the start of any element
Data and other attributes defined here:
- dispatchEndMapping = {}
- nodeMapping = {'database': <class 'pytable.dbschema.DatabaseSchema'>}
Methods inherited from Propertied:
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data and other attributes inherited from Propertied:
- __dict__ = <dictproxy object at 0x01FE0FD0>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Propertied' objects>
- list of weak references to the object (if defined)
| |