def value (self, node, type_fns):
        # Does the attrib have the attribute at all?
        # If not use the template default 
        if not self.field in node.__dict__:
            return self.default
        
        value = node.__dict__[self.field]
        
        # If it's null use the demplate default
        if value == None:
            return self.default
        
        # Run optional custom code, for example loading
        # a sub attribute of the object
        if self.evaluate != None:
            value = eval (self.evaluate) 
        
        # If that yielded null use the template default
        if value == None:
            return self.default
        
        # Run a converter assocuated with it's type
        # Possibly loaded from a plugin
        value = type_fns[self.type] (value) 
        
        # If that yielded null use the template default
        if value == None:
            return self.default
        
        # Finally, having got a non-null string format it with the format associated with the field
        return self.format_template.safe_substitute (value=value)
dataset/ETHPy150Open psidnell/ofexport/src/main/python/attrib_convert.py/Conversion.value/original