def convertFromStr(self, value, type):
        if value is not None:
            if type == 'str':
                return str(value)
            elif value.strip() != '':
                if type == 'long':
                    return long(value)
                elif type == 'float':
                    return float(value)
                elif type == 'int':
                    return int(value)
                elif type == 'date':
                    return date(*time_strptime(value, '%Y-%m-%d')[0:3])
                elif type == 'datetime':
                    return datetime(*time_strptime(value, '%Y-%m-%d %H:%M:%S')[0:6])
        return None
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/db/versions/v0_6_0/persistence/xml/xml_dao.py/XMLDAO.convertFromStr/original