Beispiel #1
0
    def doIt(self):
        success = False
        error = None

        sourceAttributeName = self.argAsString("sourceAttribute")
        destinationAttributeName = self.argAsString("destinationAttribute")

        sourceAttribute = coralApp.findAttribute(sourceAttributeName)
        destinationAttribute = coralApp.findAttribute(destinationAttributeName)

        if sourceAttribute and destinationAttribute:
            if destinationAttribute.input() is not None:
                destinationAttribute.disconnectInput()

            error = ErrorObject()
            success = NetworkManager.connect(sourceAttribute,
                                             destinationAttribute, error)

        if not success:
            errorMessage = "error during connection between " + sourceAttributeName + " and " + destinationAttributeName + "\n"
            if error:
                if error.message():
                    errorMessage += "extended info: " + error.message()

            coralApp.logDebug(errorMessage)
Beispiel #2
0
    def doIt(self):
        collapsedNodeName = self.argAsString("collapsedNode")

        collapsedNode = coralApp.findNode(collapsedNodeName)
        if collapsedNode:
            if collapsedNode.className() in collapser.CollapserData.collapsableNodeNames:
                coralApp.explodeCollapsedNode(collapsedNode)
            else:
                coralApp.logDebug("ExplodeCollapsedNode Command: input node must be of type CollapsedNode")
 def doIt(self):
     from collapsedNode import CollapsedNode
     collapsedNodeName = self.argAsString("collapsedNode")
     
     collapsedNode = coralApp.findNode(collapsedNodeName)
     if collapsedNode:
         if collapsedNode.__class__ is CollapsedNode:
             coralApp.explodeCollapsedNode(collapsedNode)
         else:
             coralApp.logDebug("ExplodeCollapsedNode Command: input node must be of type CollapsedNode")
Beispiel #4
0
    def doIt(self):
        collapsedNodeName = self.argAsString("collapsedNode")

        collapsedNode = coralApp.findNode(collapsedNodeName)
        if collapsedNode:
            if collapsedNode.className(
            ) in collapser.CollapserData.collapsableNodeNames:
                coralApp.explodeCollapsedNode(collapsedNode)
            else:
                coralApp.logDebug(
                    "ExplodeCollapsedNode Command: input node must be of type CollapsedNode"
                )
Beispiel #5
0
 def doIt(self):
     className = self.argAsString("className")
     name = self.argAsString("name")
     parentNode = self.argAsString("parentNode")
     
     newNode = None
     
     parentNode = coralApp.findNode(parentNode)
     if parentNode:
         newNode = coralApp.createNode(className, name, parentNode)
         
         if newNode:
             specializationPreset = self.argAsString("specializationPreset")
             if specializationPreset:
                 newNode.enableSpecializationPreset(specializationPreset)
             
             self.setResultString(newNode.fullName())
             
     if newNode is None:
         coralApp.logDebug("CreateNode Command: failed to create new node.")
Beispiel #6
0
    def doIt(self):
        className = self.argAsString("className")
        name = self.argAsString("name")
        parentNode = self.argAsString("parentNode")

        newNode = None

        parentNode = coralApp.findNode(parentNode)
        if parentNode:
            newNode = coralApp.createNode(className, name, parentNode)

            if newNode:
                specializationPreset = self.argAsString("specializationPreset")
                if specializationPreset:
                    newNode.enableSpecializationPreset(specializationPreset)

                self.setResultString(newNode.fullName())

        if newNode is None:
            coralApp.logDebug("CreateNode Command: failed to create new node.")
Beispiel #7
0
    def doIt(self):
        className = self.argAsString("className")
        name = self.argAsString("name")
        parentNode = self.argAsString("parentNode")
        input = self.argAsBool("input")
        output = self.argAsBool("output")

        newAttr = None

        parentNode = coralApp.findNode(parentNode)
        if parentNode:
            newAttr = coralApp.createAttribute(className, name, parentNode, input, output)
            if newAttr:
                specializationOverride = self.argAsString("specializationOverride")
                if specializationOverride != "" and specializationOverride != "none":
                    newAttr.setSpecializationOverride(specializationOverride)

                self.setResultString(newAttr.fullName())

        if newAttr is None:
            coralApp.logDebug("CreateAttribute Command: failed to create new attribute.")
Beispiel #8
0
 def doIt(self):
     success = False
     error = None
     
     sourceAttributeName = self.argAsString("sourceAttribute")
     destinationAttributeName = self.argAsString("destinationAttribute")
     
     sourceAttribute = coralApp.findAttribute(sourceAttributeName)
     destinationAttribute = coralApp.findAttribute(destinationAttributeName)
     
     if sourceAttribute and destinationAttribute:
         if destinationAttribute.input() is not None:
             destinationAttribute.disconnectInput()
         
         error = ErrorObject()
         success = NetworkManager.connect(sourceAttribute, destinationAttribute, error)
         
     if not success:
         errorMessage = "error during connection between " + sourceAttributeName + " and " + destinationAttributeName + "\n"
         if error:
             if error.message():
                 errorMessage += "extended info: " + error.message()
             
         coralApp.logDebug(errorMessage)
Beispiel #9
0
    def doIt(self):
        className = self.argAsString("className")
        name = self.argAsString("name")
        parentNode = self.argAsString("parentNode")
        input = self.argAsBool("input")
        output = self.argAsBool("output")

        newAttr = None

        parentNode = coralApp.findNode(parentNode)
        if parentNode:
            newAttr = coralApp.createAttribute(className, name, parentNode,
                                               input, output)
            if newAttr:
                specializationOverride = self.argAsString(
                    "specializationOverride")
                if specializationOverride != "" and specializationOverride != "none":
                    newAttr.setSpecializationOverride(specializationOverride)

                self.setResultString(newAttr.fullName())

        if newAttr is None:
            coralApp.logDebug(
                "CreateAttribute Command: failed to create new attribute.")