Did I find the right examples for you? yes no

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)

        def wt_validator(omhe_value):
    valdict={}
    if omhe_value.endswith('l') or omhe_value.endswith('k'):
        valdict['wt_numeric']=omhe_value[:-1]
        valdict['wt_measure_unit']=omhe_value[-1]
    else:
        valdict['wt_numeric']=omhe_value
        valdict['wt_measure_unit']="l"
        
    try:
        f=float(valdict['wt_numeric'])
        if f < 0:
            error_msg="Weight may not be less than 0"
            raise InvalidValueError(error_msg)
        
    except ValueError:
        error_msg="I could not validate the value %s." % (valdict['wt_numeric'])
        raise InvalidMessageError(error_msg)
    
    return valdict
        


src/p/y/python-omhe-0.6.1/omhe/core/parseomhe.py   python-omhe(Download)
from omhe.core.validators.sbp_validator import sbp_validator
from omhe.core.validators.st_validator import st_validator
from omhe.core.validators.wt_validator import wt_validator
from omhe.core.validators.ffm_validator import ffm_validator
from omhe.core.validators.fm_validator import fm_validator

src/p/y/python-omhe-HEAD/omhe/core/parseomhe.py   python-omhe(Download)
from omhe.core.validators.sbp_validator import sbp_validator
from omhe.core.validators.st_validator import st_validator
from omhe.core.validators.wt_validator import wt_validator
from omhe.core.validators.ffm_validator import ffm_validator
from omhe.core.validators.fm_validator import fm_validator