(topicTuple: Tuple[Topic, ...])
Check that names in topicTuple are valid: no spaces, not empty.
    Raise ValueError if fails check. E.g. ('',) and ('a',' ') would
    both fail, but ('a','b') would be ok.
Check that names in topicTuple are valid: no spaces, not empty.
    Raise ValueError if fails check. E.g. ('',) and ('a',' ') would
    both fail, but ('a','b') would be ok.
Check that names in topicTuple are valid : no spaces not empty . Raise ValueError if fails check . E . g . ( ) and ( a ) would both fail but ( a b ) would be ok .
def validateNameHierarchy(topicTuple: Tuple[Topic, ...]):
    """
    Check that names in topicTuple are valid: no spaces, not empty.
    Raise ValueError if fails check. E.g. ('',) and ('a',' ') would
    both fail, but ('a','b') would be ok.
    """
    if not topicTuple:
        topicName = stringize(topicTuple)
        errMsg = 'empty topic name'
        raise TopicNameError(topicName, errMsg)

    for indx, topic in enumerate(topicTuple):
        errMsg = None
        if topic is None:
            topicName = list(topicTuple)
            topicName[indx] = 'None'
            errMsg = 'None at level #%s'

        elif not topic:
            topicName = stringize(topicTuple)
            errMsg = 'empty element at level #%s'

        elif topic.isspace():
            topicName = stringize(topicTuple)
            errMsg = 'blank element at level #%s'

        if errMsg:
            raise TopicNameError(topicName, errMsg % indx)
def validateNameHierarchy ( topicTuple : Tuple [ Topic , ... ] ) : if not topicTuple : topicName = stringize ( topicTuple ) errMsg = 'empty topic name' raise TopicNameError ( topicName , errMsg ) for indx , topic in enumerate ( topicTuple ) : errMsg = None if topic is None : topicName = list ( topicTuple ) topicName [ indx ] = 'None' errMsg = 'None at level #%s' elif not topic : topicName = stringize ( topicTuple ) errMsg = 'empty element at level #%s' elif topic . isspace ( ) : topicName = stringize ( topicTuple ) errMsg = 'blank element at level #%s' if errMsg : raise TopicNameError ( topicName , errMsg % indx )