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 0x01D54F50>
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 0x01D54670>
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 0x015C5490>, <class 'basictypes.list_types.listof_ints'>: <basicproperty.linearise.SequenceLin object at 0x015EC1F0>, <class 'basictypes.list_types.listof_bools'>: <basicproperty.linearise.SequenceLin object at 0x01616930>, <class 'basictypes.list_types.listof_longs'>: <basicproperty.linearise.SequenceLin object at 0x01616A90>, <class 'basictypes.list_types.listof_floats'>: <basicproperty.linearise.SequenceLin object at 0x01616BF0>, <class 'basictypes.list_types.listof_classnames'>: <basicproperty.linearise.SequenceLin object at 0x01616D50>, <class 'basictypes.list_types.listof_classes'>: <basicproperty.linearise.SequenceLin object at 0x01616090>, <class 'basictypes.callable.listof_Arguments'>: <basicproperty.linearise.SequenceLin object at 0x01B86610>, <class 'basictypes.callable.Callables'>: <basicproperty.linearise.SequenceLin object at 0x01B86830>, <class 'basictypes.factory.listof_Factories'>: <basicproperty.linearise.SequenceLin object at 0x01B94430>, ...}
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 'basictypes.callable.listof_Arguments'>: 'listof_Arguments', <class 'basictypes.callable.Callables'>: 'Callables', <class 'basictypes.factory.listof_Factories'>: 'listof_Factories', ...}
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 0x01D54470>
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 0x01D54730>
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 0x01D543B0>
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 0x01D54610>
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 0x01D54830>
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 0x01D54470>
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
        __file__ = r'p:\properties\basicproperty\linearise.pyc'
__name__ = 'basicproperty.linearise'
defaults = {'EndComments': 10, 'courtesyspace': ' ', 'curindent': '', 'full_element_separator': '\n', 'indent': '\t', 'mffieldsep': '\n', 'numsep': ',', 'subelspacer': ', '}
dispatch_table = {<type 'mx.DateTime.DateTime'>: <function pickle_DateTime at 0x01B6BCF0>, <type 'mx.DateTime.DateTimeDelta'>: <function pickle_DateTimeDelta at 0x01B6BE30>, <type 'complex'>: <function pickle_complex at 0x0079BF30>, <type 'nt.stat_result'>: <function _pickle_stat_result at 0x007C2170>, <type 'nt.statvfs_result'>: <function _pickle_statvfs_result at 0x007C21F0>, <type '_sre.SRE_Pattern'>: <function _pickle at 0x00863130>}