xtuml/load.py
def guess_type_name(value):
    '''
    Guess the type name of a serialized value.
    '''
    value = str(value)
    
    if value.upper() in ['TRUE', 'FALSE']:
        return 'BOOLEAN'
    
    elif re.match(r'(-)?(\d+)(\.\d+)', value):
        return 'REAL'
    
    elif re.match(r'(-)?(\d+)', value):
        return 'INTEGER'
    
    elif re.match(r'\'((\'\')|[^\'])*\'', value):
        return 'STRING'
    
    elif re.match(r'\"([^\\\n]|(\\.))*?\"', value):
        return 'UNIQUE_ID'
def guess_type_name(value):
    '''
    Guess the type name of a serialized value.
    '''
    value = str(value)
    
    if value.upper() in ['TRUE', 'FALSE']:
        return 'BOOLEAN'
    
    elif re.match(r'(-)?(\d+)(\.\d+)', value):
        return 'REAL'
    
    elif re.match(r'(-)?(\d+)', value):
        return 'INTEGER'
    
    elif re.match(r'\'((\'\')|[^\'])*\'', value):
        return 'STRING'
    
    elif re.match(r'\"([^\\\n]|(\\.))*?\"', value):
        return 'UNIQUE_ID'
def guess_type_name ( value ) : value = str ( value ) if value . upper ( ) in [ 'TRUE' , 'FALSE' ] : return 'BOOLEAN' elif re . match ( r'(-)?(\d+)(\.\d+)' , value ) : return 'REAL' elif re . match ( r'(-)?(\d+)' , value ) : return 'INTEGER' elif re . match ( r'\'((\'\')|[^\'])*\'' , value ) : return 'STRING' elif re . match ( r'\"([^\\\n]|(\\.))*?\"' , value ) : return 'UNIQUE_ID'
Guess the type name of a serialized value.
Guess the type name of a serialized value .