basicproperty.linearise
index
p:\properties\basicproperty\linearise.py

Object for linearizing a node-graph to XML

 
Modules
       
cStringIO
operator
xml.sax.saxutils
struct
sys
traceback
types

 
Classes
       
Lineariser
PicklingError(PickleError)
RootCellarError
XMLGenerator(ContentHandler)
Generator
object
LineariserHelper
GlobalLin
GlobalLin
IntLin
MappingLin
NoneLin
SequenceLin
StringLin

 
class Generator(XMLGenerator)
    Friendly generator for XML code
 
 
Method resolution order:
Generator
XMLGenerator
ContentHandler

Methods defined here:
startElement(self, name, attributes=None, **named)
Start a new element with given attributes

Methods inherited from XMLGenerator:
__init__(self, out=None, encoding='iso-8859-1')
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 GlobalLin(LineariserHelper)
    
Method resolution order:
GlobalLin
LineariserHelper
object

Methods defined here:
do(self, client, lineariser)

Data and other attributes defined here:
clientClasses = [<type 'type'>, <type 'classobj'>, <type 'type'>, <type 'function'>, <type 'builtin_function_or_method'>]
tagNames = {'globalref': 'globalref'}

Methods inherited from LineariserHelper:
__call__(self, value, lineariser)
Linearise the value using given lineariser
doRef(self, value, lineariser)
Check if we can just reference this value

Data and other attributes inherited from LineariserHelper:
__dict__ = <dictproxy object at 0x01FE0C30>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'LineariserHelper' objects>
list of weak references to the object (if defined)

 
class IntLin(LineariserHelper)
    
Method resolution order:
IntLin
LineariserHelper
object

Methods defined here:
do(self, value, lineariser)
doRef(self, value, lineariser)
Check if we can just reference this value

Data and other attributes defined here:
clientClasses = [<type 'int'>, <type 'long'>, <type 'float'>]
maxRefSize = 18446744073709551616L
minRefSize = -18446744073709551616L
tagNames = {}

Methods inherited from LineariserHelper:
__call__(self, value, lineariser)
Linearise the value using given lineariser

Data and other attributes inherited from LineariserHelper:
__dict__ = <dictproxy object at 0x01FE0C30>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'LineariserHelper' objects>
list of weak references to the object (if defined)

 
class Lineariser
    A data structure & methods for linearising
sceneGraphs, nodes, scripts and prototypes.
Should be used only once as member vars are not
cleared after the initial linearisation.
 
  Methods defined here:
__init__(self, linvalues=None, alreadydone=None, encoding='utf-8', *args, **namedargs)
fullsep(self, proto=0)
Add full seperator to the indicated buffer
globalname(self, client)
Try to find the name for the client
indent(self, proto=0)
Add current indent to the indicated buffer
linear(self, clientNode, buffer=None, skipProtos=None, *args, **namedargs)
Linearise a node/object
nodeContent(self, clientNode)
Export the contents of a given node
refName(self, target)
Get a reference id/name for a given object
reference(self, target)
Reference an object

Class methods defined here:
registerHelper(cls, clientClass, helper) from __builtin__.classobj
Register a helper object with the linearise class

Data and other attributes defined here:
lowLevelHelpers = {<class 'basictypes.list_types.listof_strings'>: <basicproperty.linearise.SequenceLin object at 0x01AEF8B0>, <class 'basictypes.list_types.listof_ints'>: <basicproperty.linearise.SequenceLin object at 0x01B3C4F0>, <class 'basictypes.list_types.listof_bools'>: <basicproperty.linearise.SequenceLin object at 0x01B3CB70>, <class 'basictypes.list_types.listof_longs'>: <basicproperty.linearise.SequenceLin object at 0x01B3CCD0>, <class 'basictypes.list_types.listof_floats'>: <basicproperty.linearise.SequenceLin object at 0x01B3CE30>, <class 'basictypes.list_types.listof_classnames'>: <basicproperty.linearise.SequenceLin object at 0x01B3CF90>, <class 'basictypes.list_types.listof_classes'>: <basicproperty.linearise.SequenceLin object at 0x01B450F0>, <class 'wxoo.typeregistry.list_of_ClassInfos'>: <basicproperty.linearise.SequenceLin object at 0x01BA1170>, <class 'wxoo.propertydescriptor.listof_Descriptors'>: <basicproperty.linearise.SequenceLin object at 0x01BA1D70>, <class 'basictypes.callable.listof_Arguments'>: <basicproperty.linearise.SequenceLin object at 0x01BE1B30>, ...}
protoalreadydone = {<class 'basictypes.list_types.listof_strings'>: 'listof_strings', <class 'basictypes.list_types.listof_ints'>: 'listof_ints', <class 'basictypes.list_types.listof_bools'>: 'listof_bools', <class 'basictypes.list_types.listof_longs'>: 'listof_longs', <class 'basictypes.list_types.listof_floats'>: 'listof_floats', <class 'basictypes.list_types.listof_classnames'>: 'listof_classnames', <class 'basictypes.list_types.listof_classes'>: 'listof_classes', <class 'wxoo.typeregistry.list_of_ClassInfos'>: 'list_of_ClassInfos', <class 'wxoo.propertydescriptor.listof_Descriptors'>: 'listof_Descriptors', <class 'basictypes.callable.listof_Arguments'>: 'listof_Arguments', ...}
volatile = 0

 
class LineariserHelper(object)
     Methods defined here:
__call__(self, value, lineariser)
Linearise the value using given lineariser
do(self, value, lineariser)
Do the primary work of linearising
doRef(self, value, lineariser)
Check if we can just reference this value

Data and other attributes defined here:
__dict__ = <dictproxy object at 0x01FE0B30>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'LineariserHelper' objects>
list of weak references to the object (if defined)
clientClasses = ()
tagNames = {}

 
class MappingLin(LineariserHelper)
    
Method resolution order:
MappingLin
LineariserHelper
object

Methods defined here:
do(self, value, lineariser)

Data and other attributes defined here:
clientClasses = [<type 'dict'>]
tagNames = {'key': 'key', 'val': 'val'}

Methods inherited from LineariserHelper:
__call__(self, value, lineariser)
Linearise the value using given lineariser
doRef(self, value, lineariser)
Check if we can just reference this value

Data and other attributes inherited from LineariserHelper:
__dict__ = <dictproxy object at 0x01FE0B30>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'LineariserHelper' objects>
list of weak references to the object (if defined)

 
class NoneLin(LineariserHelper)
    
Method resolution order:
NoneLin
LineariserHelper
object

Methods defined here:
do(self, value, lineariser)
doRef(self, value, lineariser)
Check if we can just reference this value

Data and other attributes defined here:
clientClasses = [<type 'NoneType'>]
tagNames = {'none': 'none'}

Methods inherited from LineariserHelper:
__call__(self, value, lineariser)
Linearise the value using given lineariser

Data and other attributes inherited from LineariserHelper:
__dict__ = <dictproxy object at 0x01FE0B30>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'LineariserHelper' objects>
list of weak references to the object (if defined)

 
class RootCellarError(PicklingError)
    Root error raised by the rootcellar lineariser
 
 
Method resolution order:
RootCellarError
PicklingError
PickleError
Exception

Methods defined here:
__str__(self)
append(self, element)
Append an element to the stack

Methods inherited from Exception:
__getitem__(...)
__init__(...)

 
class SequenceLin(LineariserHelper)
    
Method resolution order:
SequenceLin
LineariserHelper
object

Methods defined here:
do(self, value, lineariser)

Data and other attributes defined here:
clientClasses = [<type 'list'>, <type 'tuple'>]
tagNames = {'li': 'li'}

Methods inherited from LineariserHelper:
__call__(self, value, lineariser)
Linearise the value using given lineariser
doRef(self, value, lineariser)
Check if we can just reference this value

Data and other attributes inherited from LineariserHelper:
__dict__ = <dictproxy object at 0x01FE0C70>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'LineariserHelper' objects>
list of weak references to the object (if defined)

 
class StringLin(LineariserHelper)
    
Method resolution order:
StringLin
LineariserHelper
object

Methods defined here:
do(self, value, lineariser)
doRef(self, value, lineariser)
Check if we can just reference this value

Data and other attributes defined here:
clientClasses = [<type 'str'>, <type 'unicode'>]
minRefLength = 64
tagNames = {}

Methods inherited from LineariserHelper:
__call__(self, value, lineariser)
Linearise the value using given lineariser

Data and other attributes inherited from LineariserHelper:
__dict__ = <dictproxy object at 0x01FE0C30>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'LineariserHelper' objects>
list of weak references to the object (if defined)

 
cls = class GlobalLin(LineariserHelper)
    
Method resolution order:
GlobalLin
LineariserHelper
object

Methods defined here:
do(self, client, lineariser)

Data and other attributes defined here:
clientClasses = [<type 'type'>, <type 'classobj'>, <type 'type'>, <type 'function'>, <type 'builtin_function_or_method'>]
tagNames = {'globalref': 'globalref'}

Methods inherited from LineariserHelper:
__call__(self, value, lineariser)
Linearise the value using given lineariser
doRef(self, value, lineariser)
Check if we can just reference this value

Data and other attributes inherited from LineariserHelper:
__dict__ = <dictproxy object at 0x01FE0C30>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'LineariserHelper' objects>
list of weak references to the object (if defined)

 
Functions
       
_findUnusedKey(dictionary, baseName)
Find an unused name similar to baseName in dict
linearise(value, linvalues={'EndComments': 10, 'courtesyspace': ' ', 'curindent': '', 'full_element_separator': '\n', 'indent': '\t', 'mffieldsep': '\n', 'numsep': ',', 'subelspacer': ', '}, **namedargs)
Linearise the given (node) value to a string

 
Data
        defaults = {'EndComments': 10, 'courtesyspace': ' ', 'curindent': '', 'full_element_separator': '\n', 'indent': '\t', 'mffieldsep': '\n', 'numsep': ',', 'subelspacer': ', '}
dispatch_table = {<type 'array'>: <function pickle_array at 0x015B9A30>, <type 'mx.DateTime.DateTime'>: <function pickle_DateTime at 0x01B51670>, <type 'mx.DateTime.DateTimeDelta'>: <function pickle_DateTimeDelta at 0x01B517B0>, <type 'libpq.PgBoolean'>: <function pickle_PgBoolean at 0x01EA77B0>, <type 'PgInt2'>: <function pickle_PgInt2 at 0x01EA7830>, <type 'PgInt8'>: <function pickle_PgInt8 at 0x01EA7870>, <type 'libpq.PgVersion'>: <function pickle_PgVersion at 0x01EA78F0>, <type 'libpq.PgLargeObject'>: <function pickle_PgLargeObject at 0x01EA78B0>, <type 'libpq.PgConnection'>: <function pickle_PgConnection at 0x01EA77F0>, <type 'complex'>: <function pickle_complex at 0x0079BF30>, ...}