(self, value)
return value
Convert values to an appropriate type. dicts, lists and tuples are
        replaced by their converting alternatives. Strings are checked to
        see if they have a conversion format and are converted if they do.
Convert values to an appropriate type. dicts, lists and tuples are
        replaced by their converting alternatives. Strings are checked to
        see if they have a conversion format and are converted if they do.
Convert values to an appropriate type . dicts lists and tuples are replaced by their converting alternatives . Strings are checked to see if they have a conversion format and are converted if they do .
def convert(self, value):
        """
        Convert values to an appropriate type. dicts, lists and tuples are
        replaced by their converting alternatives. Strings are checked to
        see if they have a conversion format and are converted if they do.
        """
        if not isinstance(value, ConvertingDict) and isinstance(value, dict):
            value = ConvertingDict(value)
            value.configurator = self
        elif not isinstance(value, ConvertingList) and isinstance(value, list):
            value = ConvertingList(value)
            value.configurator = self
        elif not isinstance(value, ConvertingTuple) and\
                 isinstance(value, tuple) and not hasattr(value, '_fields'):
            value = ConvertingTuple(value)
            value.configurator = self
        elif isinstance(value, str): # str for py3k
            m = self.CONVERT_PATTERN.match(value)
            if m:
                d = m.groupdict()
                prefix = d['prefix']
                converter = self.value_converters.get(prefix, None)
                if converter:
                    suffix = d['suffix']
                    converter = getattr(self, converter)
                    value = converter(suffix)
        return value
def convert ( self , value ) : if not isinstance ( value , ConvertingDict ) and isinstance ( value , dict ) : value = ConvertingDict ( value ) value . configurator = self elif not isinstance ( value , ConvertingList ) and isinstance ( value , list ) : value = ConvertingList ( value ) value . configurator = self elif not isinstance ( value , ConvertingTuple ) and isinstance ( value , tuple ) and not hasattr ( value , '_fields' ) : value = ConvertingTuple ( value ) value . configurator = self elif isinstance ( value , str ) : # str for py3k m = self . CONVERT_PATTERN . match ( value ) if m : d = m . groupdict ( ) prefix = d [ 'prefix' ] converter = self . value_converters . get ( prefix , None ) if converter : suffix = d [ 'suffix' ] converter = getattr ( self , converter ) value = converter ( suffix ) return value