Add "Notes" tab with "comment"/"invalid comment" attributes

Add two internal attributes, "Comment" and "Invalid comment", in
a specific "Notes" tab, which will contain any further internal
attribute. Internal attributes exist for all nodes.
This commit is contained in:
Candice Bentéjac 2022-10-12 09:47:24 +01:00
parent 1fc2b228af
commit 9bc9e2c129
6 changed files with 146 additions and 3 deletions

View file

@ -687,9 +687,24 @@ class Graph(BaseObject):
# type: (str) -> Attribute
"""
Return the attribute identified by the unique name 'fullName'.
If it does not exist, return None.
"""
node, attribute = fullName.split('.', 1)
return self.node(node).attribute(attribute)
if self.node(node).hasAttribute(attribute):
return self.node(node).attribute(attribute)
return None
@Slot(str, result=Attribute)
def internalAttribute(self, fullName):
# type: (str) -> Attribute
"""
Return the internal attribute identified by the unique name 'fullName'.
If it does not exist, return None.
"""
node, attribute = fullName.split('.', 1)
if self.node(node).hasInternalAttribute(attribute):
return self.node(node).internalAttribute(attribute)
return None
@staticmethod
def getNodeIndexFromName(name):