Package gavo :: Package base :: Module structure :: Class DataContent
[frames] | no frames]

Class DataContent

source code

          object --+            
                   |            
attrdef.AttributeDef --+        
                       |        
 attrdef.AtomicAttribute --+    
                           |    
    attrdef.UnicodeAttribute --+
                               |
                              DataContent

A magic attribute that allows character content to be added to a structure.

You can configure it with all the arguments available for UnicodeAttribute.

Since parsers may call characters with an empty string for empty elements, the empty string will not be fed (i.e., the default will be preserved). This makes setting an empty string as an element content impossible (you could use DataContent with strip=True, though), but that's probably not a problem.

Instance Methods
 
__init__(self, default='', description='Undocumented', **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
feed(self, ctx, instance, value) source code
 
makeUserDoc(self) source code

Inherited from attrdef.UnicodeAttribute: parse, unparse

Inherited from attrdef.AtomicAttribute: feedObject, getCopy

Inherited from attrdef.AttributeDef: doCallbacks, iterParentMethods

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  typeDesc_ = 'string'
Properties

Inherited from object: __class__

Method Details

__init__(self, default='', description='Undocumented', **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

feed(self, ctx, instance, value)

source code 
Overrides: attrdef.AttributeDef.feed

makeUserDoc(self)

source code 
Overrides: attrdef.AttributeDef.makeUserDoc