Пример #1
0
    def removeAttribute(self, tSet, inputAtt, whichAtt):
        attToDel = None
        # Getting a reference to the attribute to del
        if (inputAtt == True):
            if (self.storeAttributesAsNonStatic and self.attributes != None):
                attToDel = self.attributes.getInputAttribute(whichAtt)
            else:
                attToDel = Attributes.getInputAttribute(whichAtt)

        else:
            if (self.storeAttributesAsNonStatic and self.attributes != None):
                attToDel = self.attributes.getOutputAttribute(whichAtt)
            else:
                attToDel = Attributes.getOutputAttribute(whichAtt)

        if (self.storeAttributesAsNonStatic == True
                and self.attributes != None):
            print("Removing the attribute")
        if (self.attributes.removeAttribute(inputAtt, whichAtt) == False
                or (tSet != None and tSet.attributes.removeAttribute(
                    inputAtt, whichAtt)) == False):
            return False
        else:
            if (Attributes.removeAttribute(inputAtt, whichAtt) == False):
                return False
        for i in range(0, len(self.instanceSet)):
            if (self.storeAttributesAsNonStatic and self.attributes != None):
                self.instanceSet[i].removeAttribute(self.attributes, attToDel,
                                                    inputAtt, whichAtt)
            else:
                self.instanceSet[i].removeAttribute(attToDel, inputAtt,
                                                    whichAtt)

        if (tSet != None):
            for i in range(0, tSet.instanceSet.length):

                if (self.storeAttributesAsNonStatic == True
                        and self.attributes != None):
                    tSet.instanceSet[i].removeAttribute(
                        self.attributes, attToDel, inputAtt, whichAtt)
            else:
                tSet.instanceSet[i].removeAttribute(attToDel, inputAtt,
                                                    whichAtt)
            return True
    def removeAttribute(self, tSet, inputAtt, whichAtt):
        attToDel = None
        # Getting a reference to the attribute to del
        if inputAtt:
            if self.storeAttributesAsNonStatic and self.attributes is not None:
                attToDel = self.attributes.getInputAttribute(whichAtt)
            else:
                attToDel = Attributes.getInputAttribute(whichAtt)

        else:
            if self.storeAttributesAsNonStatic and self.attributes is not None:
                attToDel = self.attributes.getOutputAttribute(whichAtt)
            else:
                attToDel = Attributes.getOutputAttribute(whichAtt)

        if self.storeAttributesAsNonStatic and self.attributes is not None:
            print("Removing the attribute")
        if (not self.attributes.removeAttribute(inputAtt, whichAtt) or
            (tSet is not None
             and not tSet.attributes.removeAttribute(inputAtt, whichAtt))):
            return False
        else:
            if not Attributes.removeAttribute(inputAtt, whichAtt):
                return False
        for i in range(0, len(self.instanceSet)):
            if self.storeAttributesAsNonStatic and self.attributes is not None:
                self.instanceSet[i].removeAttribute(self.attributes, attToDel,
                                                    inputAtt, whichAtt)
            else:
                self.instanceSet[i].removeAttribute(attToDel, inputAtt,
                                                    whichAtt)

        if tSet is not None:
            for i in range(0, tSet.instanceSet.length):

                if self.storeAttributesAsNonStatic and self.attributes is not None:
                    tSet.instanceSet[i].removeAttribute(
                        self.attributes, attToDel, inputAtt, whichAtt)
            else:
                tSet.instanceSet[i].removeAttribute(attToDel, inputAtt,
                                                    whichAtt)
            return True