Package svnmailer :: Module struct_accessors :: Class HumanBooleanDescriptor
[hide private]

Class HumanBooleanDescriptor

source code

                  object --+        
                           |        
typedstruct.MemberDescriptor --+    
                               |    
                  BaseDescriptor --+
                                   |
                                  HumanBooleanDescriptor

Boolean storage with translater from human readable booleans

Instance Methods [hide private]
 
__init__(self, name, private, param=None)
Initialization
source code
any
doTransform(self, value, arg)
Turns into boolean
source code

Inherited from BaseDescriptor: doPostmap, doPremap, doSubstitute, getCharset, getFileCharset, postmap, premap, substitute, transform

Inherited from typedstruct.MemberDescriptor: __delete__, __get__, __set__

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

Class Variables [hide private]
tuple TRUE = ('1', 'yes', 'on', 'true')
The true words (tuple of str)
tuple FALSE = ('', '0', 'no', 'off', 'false', 'none')
The false words (tuple of str)
Instance Variables [hide private]
dict HUMAN
The dictionary containing true and false keys

Inherited from typedstruct.MemberDescriptor: name, param

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, private, param=None)
(Constructor)

source code 

Initialization

Overrides: object.__init__

doTransform(self, value, arg)

source code 

Turns into boolean

Parameters:
  • value - The value to tranform
  • arg - The argument used for struct initialization
Returns: any
The transformed value
Raises:
  • ValueError - The supplied value was not recognized as human boolean
Overrides: BaseDescriptor.doTransform