Ejemplo n.º 1
0
    def checkNodeAttrsForm(self, dictNodeAttrs):
        '''Return None if an attribute of a node is not valid, else an error
        message.

        Argument(s):
        dictNodeAttrs (str): Dot attributes values of the nodes
        '''
        message = DotAttrsUtilsV1_0.checkNodeAttrsForm(self, dictNodeAttrs)
        # If message is not None, then there is an invalid attribute
        if message:
            return message

        # Check color attribute
        if (NodeDotAttrs.color.value in dictNodeAttrs
                and not NodeDotColorUtils.isColorValid(
                    dictNodeAttrs[NodeDotAttrs.color.value])):
            return DotAttrsUtilsV1_0.formatErrorMessage(
                self, NodeDotAttrs.color.value,
                dictNodeAttrs[NodeDotAttrs.color.value])

        # All attributes are valid
        return None
Ejemplo n.º 2
0
    def checkNodeAttrsForm(self, dictNodeAttrs):
        '''Return None if an attribute of a node is not valid, else an error
        message.

        Argument(s):
        dictNodeAttrs (str): Dot attributes values of the nodes
        '''
        message = DotAttrsUtilsV1_0.checkNodeAttrsForm(self, dictNodeAttrs)
        # If message is not None, then there is an invalid attribute
        if message:
            return message

        # Check color attribute
        if (NodeDotAttrs.color.value in dictNodeAttrs and
            not NodeDotColorUtils.isColorValid(dictNodeAttrs
                                               [NodeDotAttrs.color.value])):
            return DotAttrsUtilsV1_0.formatErrorMessage(
                self,
                NodeDotAttrs.color.value,
                dictNodeAttrs[NodeDotAttrs.color.value]
            )

        # All attributes are valid
        return None