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

Class UnicodeDescriptor

source code

                  object --+            
                           |            
typedstruct.MemberDescriptor --+        
                               |        
                  BaseDescriptor --+    
                                   |    
               BasePostmapDescriptor --+
                                       |
                                      UnicodeDescriptor

Unicode object storage

Instance Methods [hide private]
any
doTransform(self, value, arg)
Transforms the value to unicode if it wasn't already
source code
any
doSubstitute(self, value, subst, arg)
Substitutes the value
source code
 
doPostmap(self, value, mapper, arg)
Maps the value
source code

Inherited from BasePostmapDescriptor: doPremap

Inherited from BaseDescriptor: __init__, 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__

Instance Variables [hide private]

Inherited from typedstruct.MemberDescriptor: name, param

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

doTransform(self, value, arg)

source code 

Transforms the value to unicode if it wasn't already

Parameters:
  • value - The value to tranform
  • arg - The argument used for struct initialization
Returns: any
The transformed value
Raises:
  • TypeError - The supplied value is neither str nor unicode
  • UnicodeError - The supplied value is a string and cannot be interpreted as the specified charset
Overrides: BaseDescriptor.doTransform

doSubstitute(self, value, subst, arg)

source code 

Substitutes the value

Parameters:
  • value - The value to substitute
  • subst - The substitution dictionary
  • arg - The argument used for struct initialization
Returns: any
The substituted value
Overrides: BaseDescriptor.doSubstitute

doPostmap(self, value, mapper, arg)

source code 

Maps the value

Parameters:
  • value - The value to premap
  • mapper - The mapper function
  • arg - The argument used for struct initialization
Raises:
  • TypeError - The mapped value is neither str nor unicode
  • UnicodeError - The mapped value is a string and cannot be interpreted as the specified charset
Overrides: BaseDescriptor.doPostmap