Exemplo n.º 1
0
def _validateOther(text):
    text = text.strip()
    n = len(text)
    if n == 0:
        return Pmw.OK
    elif n > 4:
        return Pmw.ERROR
    elif n < 3:
        return Pmw.PARTIAL
    return Pmw.alphanumericvalidator(text)
Exemplo n.º 2
0
def _validateMetar(text):
    if not text:
        return Pmw.PARTIAL
    for x in text.split(','):
        n = len(x)
        if n == 0:
            continue
        elif n > 4:
            return Pmw.ERROR
        elif n < 4:
            return Pmw.PARTIAL
        if Pmw.alphanumericvalidator(x) == Pmw.ERROR:
            return Pmw.ERROR
    return Pmw.OK
Exemplo n.º 3
0
def _validateProfiler(text):
    text = text.strip()
    if not text:
        return Pmw.OK
    for x in text.split(','):
        n = len(x)
        if n == 0:
            continue
        elif n > 5:
            return Pmw.ERROR
        elif n < 5:
            return Pmw.PARTIAL
        if Pmw.alphanumericvalidator(x) == Pmw.ERROR:
            return Pmw.ERROR
    return Pmw.OK