qteasy/_arg_validators.py
def _validate_key_and_value(key, value):
    """ given one key, validate the key according to vkwargs dict
        return True if the key is valid
        raise if the key is not valid

    :param key:
    :param value:
    :return:
    """
    vkwargs = _valid_qt_kwargs()
    if key not in vkwargs:
        return False
    else:
        try:
            valid = vkwargs[key]['Validator'](value)
        except Exception as ex:
            ex.extra_info = f'kwarg {key} validator raised exception to value: {str(value)}'
            raise
        if not valid:
            import inspect
            v = inspect.getsource(vkwargs[key]['Validator']).strip()
            raise TypeError(
                    f'kwarg {key} validator returned False for value: {str(value)} of type {type(value)}\n'
                    f'Extra information: \n{vkwargs[key]["text"]}\n    ' + v)
            # ---------------------------------------------------------------
            #      At this point , if we have not raised an exception,
            #      then kwarg is valid as far as we can tell.

    return True
 given one key, validate the key according to vkwargs dict
        return True if the key is valid
        raise if the key is not valid

    :param key:
    :param value:
    :return:
    
given one key, validate the key according to vkwargs dict
return True if the key is valid
raise if the key is not valid
given one key validate the key according to vkwargs dict return True if the key is valid raise if the key is not valid
def _validate_key_and_value(key, value):
    vkwargs = _valid_qt_kwargs()
    if key not in vkwargs:
        return False
    else:
        try:
            valid = vkwargs[key]['Validator'](value)
        except Exception as ex:
            ex.extra_info = f'kwarg {key} validator raised exception to value: {str(value)}'
            raise
        if not valid:
            import inspect
            v = inspect.getsource(vkwargs[key]['Validator']).strip()
            raise TypeError(
                    f'kwarg {key} validator returned False for value: {str(value)} of type {type(value)}\n'
                    f'Extra information: \n{vkwargs[key]["text"]}\n    ' + v)
    return True
def _validate_key_and_value ( key , value ) : vkwargs = _valid_qt_kwargs ( ) if key not in vkwargs : return False else : try : valid = vkwargs [ key ] [ 'Validator' ] ( value ) except Exception as ex : ex . extra_info = f'kwarg {key} validator raised exception to value: {str(value)}' raise if not valid : import inspect v = inspect . getsource ( vkwargs [ key ] [ 'Validator' ] ) . strip ( ) raise TypeError ( f'kwarg {key} validator returned False for value: {str(value)} of type {type(value)}\n' f'Extra information: \n{vkwargs[key]["text"]}\n    ' + v ) return True
given one key, validate the key according to vkwargs dict
return True if the key is valid
raise if the key is not valid
given one key validate the key according to vkwargs dict return True if the key is valid raise if the key is not valid
""" given one key, validate the key according to vkwargs dict
        return True if the key is valid
        raise if the key is not valid

    :param key:
    :param value:
    :return:
    """ # --------------------------------------------------------------- #      At this point , if we have not raised an exception, #      then kwarg is valid as far as we can tell.
None
key
None
value
None