Package gavo :: Package base :: Module attrdef :: Class AtomicAttribute
[frames] | no frames]

Class AtomicAttribute

source code

  object --+    
           |    
AttributeDef --+
               |
              AtomicAttribute
Known Subclasses:

A base class for attributes than can be immediately parsed and unparsed from strings.

They need to provide a parse method taking a unicode object and returning a value of the proper type, and an unparse method taking a value of the proper type and returning a unicode string suitable for parse.

Note that you can, of course, assign to the attribute directly. If you assign crap, the unparse method is explicitely allowed to bomb in random ways; it just has to be guaranteed to work for values coming from parse (i.e.: user input is checked, programmatic input can blow up the thing; I consider this pythonesque :-).

Instance Methods
 
feed(self, ctx, instance, value) source code
 
feedObject(self, instance, value) source code
 
getCopy(self, instance, newParent, ctx) source code
 
makeUserDoc(self) source code
 
parse(self, value)
returns a typed python value for the string representation value.
source code
 
unparse(self, value)
returns a typed python value for the string representation value.
source code

Inherited from AttributeDef: __init__, doCallbacks, iterParentMethods

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

Class Variables

Inherited from AttributeDef: typeDesc_

Properties

Inherited from object: __class__

Method Details

feed(self, ctx, instance, value)

source code 
Overrides: AttributeDef.feed

feedObject(self, instance, value)

source code 
Overrides: AttributeDef.feedObject

getCopy(self, instance, newParent, ctx)

source code 
Overrides: AttributeDef.getCopy

makeUserDoc(self)

source code 
Overrides: AttributeDef.makeUserDoc

parse(self, value)

source code 

returns a typed python value for the string representation value.

value can be expected to be a unicode string.

unparse(self, value)

source code 

returns a typed python value for the string representation value.

value can be expected to be a unicode string.