Ejemplo n.º 1
0
def _validate_symbolSet(obj, **kwArgs):
    logger = kwArgs['logger']

    try:
        n = int(obj[:-1])
        ok = True
    except:
        ok = False

    if not ok:
        logger.error((
            'V0794', (obj, ),
            "The first part of the symbol set code '%s' is not a valid number."
        ))

        return False

    if not valassist.isNumber_integer_unsigned(
            n, numBits=11, label="symbol set number", logger=logger):

        return False

    n = ord(obj[-1]) - 64

    if not valassist.isNumber_integer_unsigned(
            n, numBits=6, label="symbol set ID", logger=logger):

        return False

    return True
Ejemplo n.º 2
0
def _validate_tupleIndex(obj, **kwArgs):
    if obj is None:
        return True

    if not valassist.isNumber_integer_unsigned(obj, numBits=16, **kwArgs):
        return False

    return True
Ejemplo n.º 3
0
def _validate_numberOfYLines(obj, **kwArgs):
    kwArgs.pop('numBits', None)

    if not valassist.isNumber_integer_unsigned(obj, numBits=16, **kwArgs):
        return False

    if obj == 0 or obj > 500:
        kwArgs['logger'].warning(
            ('V0595', (obj, ),
             "The numberOfYLines value %s is zero or is unusually large."))

    return True
Ejemplo n.º 4
0
def _validate_directionality(obj, **kwArgs):
    logger = kwArgs['logger']

    isOK = valassist.isNumber_integer_unsigned(obj,
                                               label="directionality",
                                               logger=logger,
                                               numBits=5)

    if not isOK:
        return False

    return True
Ejemplo n.º 5
0
def _validate_directionality(obj, **kwArgs):
    logger = kwArgs['logger']
    
    isOK = valassist.isNumber_integer_unsigned(
      obj,
      label = "directionality",
      logger = logger,
      numBits = 5)
    
    if not isOK:
        return False
    
    if obj > 11:
        logger.error((
          'V0781',
          (int(obj),),
          "A Directionality value of %d cannot be used in a 'prop' table "
          "earlier than version 3. Please convert the table."))
        
        return False
    
    return True