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)
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
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