2 """ This class provides access to the underlying data model. 6 """ Return the children of a container object. 8 raise NotImplementedError
11 """ Return if the object is a container object. 13 raise NotImplementedError
16 """ Return a string that is used as caption of an object. 18 raise NotImplementedError
21 """ Return the list of the properties of an object. 23 Each property is represented by a tuple containing its 24 type, name, value, description, readonly(True/False), deletable(True/False). 25 Possible types are: 'Category','String','MultilineString','File','FileVector','Boolean','Integer','Double'. 27 raise NotImplementedError
30 """ Change the property 'name' of an object to a new value. 32 raise NotImplementedError
35 """ Add the property 'name' to an object. 37 raise NotImplementedError
40 """ Remove the property 'name' from an object. 42 raise NotImplementedError
45 """ Returns property with given name. 49 propertiesDict[p[1]] = p
50 if name
in propertiesDict.keys():
51 return propertiesDict[name]
56 """ Returns value of property with given name. 65 """ Collect all children of children of an object. 73 """ Return top level objects, e.g. the event. 75 raise NotImplementedError
78 """ This class gives a comfortable Interface to objects accessible via an accessor. 80 Given the object and the accessor all properties and attributes of the object and 81 the accessor are accessible via __getattr__. A script in which all attributes 82 of the objects can be accessed can be run. 84 def __init__(self, object, accessor, throwAttributeErrors=True):
90 if attr
in [p[1]
for p
in self._accessor.properties(self.
_object)]:
91 return self._accessor.propertyValue(self.
_object, attr)
92 elif hasattr(self.
_object, attr):
93 return getattr(self.
_object, attr)
98 raise AttributeError(
"object has no property '" + attr +
"'")
104 exec(
"result=" +
str(script))
def propertyValue(self, object, name)
def properties(self, object)
def __init__(self, object, accessor, throwAttributeErrors=True)
def __getattr__(self, attr)
def runScript(self, script)
def removeProperty(self, object, name)
def property(self, object, name)
def children(self, object)
def setProperty(self, object, name, value, categoryName)
def topLevelObjects(self)
def addProperty(self, object, name, value, type)
def isContainer(self, object)
def allChildren(self, object)