Пример #1
0
def validate_flows(value, displayedName="Flows"):
    errors = []
    if not validation.is_valid_uint(value):
        errors.append(validation.invalid_uint(displayedName))
    elif int(value) > MAX_FLOWS:
        errors.append(displayedName + " must be a positive integer within range [1, 2000)")

    return errors
Пример #2
0
def validate_QC(value, displayedName):
    errors = []
    if not validation.is_valid_uint(value):
        errors.append(validation.invalid_uint(displayedName))
    elif int(value) > MAX_QC_INT:
        errors.append(displayedName + " must be a positive whole number within range [1, 100)")

    return errors
Пример #3
0
def validate_QC(value, displayedName):
    errors = []
    if not validation.is_valid_uint(value):
        errors.append(validation.invalid_uint(displayedName))
    elif int(value) > MAX_QC_INT:
        errors.append(displayedName + ' must be a positive whole number within range [1, 100)')
    
    return errors
Пример #4
0
def validate_flows(value, displayedName='Flows'):
    errors = []
    if not validation.is_valid_uint(value):
        errors.append(validation.invalid_uint(displayedName))
    elif int(value) > MAX_FLOWS:
        errors.append(displayedName +
                      ' must be a positive integer within range [1, 2000)')

    return errors
Пример #5
0
def validate_QC(value, field_label):
    errors = []
    if not validation.is_valid_uint(value):
        errors.append(validation.invalid_uint(field_label))
    elif int(value) > MAX_QC_INT:
        errors.append(
            validation.invalid_range(field_label, MIN_QC_INT, MAX_QC_INT))

    return errors
Пример #6
0
def validate_flows(value, displayedName='Flows'):
    errors = []
    if type(value) != int and value.isdigit():
        value2 = int(value)
    else:
        value2 = value
            
    if type(value2) == int:
        if not validation.is_valid_uint(value2):
            errors.append(validation.invalid_uint(displayedName))
        elif value2 > MAX_FLOWS:
            errors.append(displayedName + ' must be a positive integer within range [1, 2000]' )
    else:
        errors.append(displayedName + ' must be a positive integer within range [1, 2000]' )
    
    return errors
Пример #7
0
def validate_flows(value, field_label):
    errors = []
    if type(value) != int and value.isdigit():
        value2 = int(value)
    else:
        value2 = value

    if type(value2) == int:
        if not validation.is_valid_uint(value2):
            errors.append(validation.invalid_uint(field_label))
        elif value2 < MIN_FLOWS or value2 > MAX_FLOWS:
            errors.append(
                validation.invalid_range(field_label, MIN_FLOWS, MAX_FLOWS))
    else:
        errors.append(
            validation.invalid_range(field_label, MIN_FLOWS, MAX_FLOWS))

    return errors