parameters: (self, intliststring)
return_statement: return True, '', intliststring
docstring: Validate whether the string can be divided into integer strings.
          Allowed: a, b, c-d, e, f, g:h
          and replace ':' by ':'
          :return: 3-tuple: state/error message/new integer list string
docstring_summary: Validate whether the string can be divided into integer strings.
          Allowed: a, b, c-d, e, f, g:h
          and replace ':' by ':'
          :return: 3-tuple: state/error message/new integer list string
docstring_tokens: Validate whether the string can be divided into integer strings . Allowed : a b c - d e f g : h and replace : by : : return : 3 - tuple : state / error message / new integer list string
function: def validateIntegerList(self, intliststring):
          """ Validate whether the string can be divided into integer strings.
          Allowed: a, b, c-d, e, f, g:h
          and replace ':' by ':'
          :return: 3-tuple: state/error message/new integer list string
          """
          intliststring = str(intliststring)
          if intliststring == "":
              return True, "", intliststring
  
          # replace ':' by '-'
          intliststring = intliststring.replace(':', '-')
  
          # 1. Split by ","
          termlevel0s = intliststring.split(",")
  
          # 2. For each term
          for level0term in termlevel0s:
              numdashes = level0term.count("-")
              if numdashes == 0:
                  # One integer
                  valuestr = level0term.strip()
                  try:
                      intvalue = int(valuestr)
                      if str(intvalue) != valuestr:
                          err_msg = 'String {0} cannot be converted to an integer properly.'.format(valuestr)
                          return False, err_msg, ''
                  except ValueError:
                      err_msg = 'String {0} cannot be converted to an integer.'.format(valuestr)
                      return False, err_msg, ''
  
              elif numdashes == 1:
                  # Integer range
                  twoterms = level0term.split("-")
                  for valuestr in twoterms:
                      try:
                          intvalue = int(valuestr)
                          if str(intvalue) != valuestr:
                              return (False, level0term)
                      except ValueError:
                          return (False, level0term)
                  # ENDFOR
  
              else:
                  return False, level0term, intliststring
          # ENDFOR
  
          return True, '', intliststring
function_tokens: def validateIntegerList ( self , intliststring ) : intliststring = str ( intliststring ) if intliststring == "" : return True , "" , intliststring # replace ':' by '-' intliststring = intliststring . replace ( ':' , '-' ) # 1. Split by "," termlevel0s = intliststring . split ( "," ) # 2. For each term for level0term in termlevel0s : numdashes = level0term . count ( "-" ) if numdashes == 0 : # One integer valuestr = level0term . strip ( ) try : intvalue = int ( valuestr ) if str ( intvalue ) != valuestr : err_msg = 'String {0} cannot be converted to an integer properly.' . format ( valuestr ) return False , err_msg , '' except ValueError : err_msg = 'String {0} cannot be converted to an integer.' . format ( valuestr ) return False , err_msg , '' elif numdashes == 1 : # Integer range twoterms = level0term . split ( "-" ) for valuestr in twoterms : try : intvalue = int ( valuestr ) if str ( intvalue ) != valuestr : return ( False , level0term ) except ValueError : return ( False , level0term ) # ENDFOR else : return False , level0term , intliststring # ENDFOR return True , '' , intliststring