Package gnue :: Package common :: Package logic :: Module GTriggerCore :: Class GTriggerCore
[show private | hide private]

Class GTriggerCore

Known Subclasses:
GObj

Base class for all objects that can be exported to action/trigger namespace.

Descendants can define how they want to be seen in action/trigger code by setting the following properties:
Method Summary
  __init__(self)
Initialize a GTriggerCore instance.
  __repr__(self)
  create_namespace_object(self, global_namespace, namespace_name)
Construct a namespace object tree from an XML (definitions.GObjects.GObj) object tree.
  get_namespace_object(self)
Return the namespace object that mirrors this object in the action/trigger namespace.
  __add_children(self, children, namespace_object, global_namespace, namespace_prefix)
Create child namespace objects according to child XML objects

Instance Variable Summary
  _triggerFunctions: Dictionary defining the functions this object should present in action/trigger code.
  _triggerGet: Can be set to a method that returns the string value of the object.
  _triggerGlobal: If set to True, this object is added to the global namespace.
  _triggerProperties: Dictionary defining the properties this object should present in action/trigger code.
  _triggerSet: Can be set to a method that sets the value of this object.

Method Details

__init__(self)
(Constructor)

Initialize a GTriggerCore instance.

__repr__(self)
(Representation operator)

create_namespace_object(self, global_namespace, namespace_name)

Construct a namespace object tree from an XML (definitions.GObjects.GObj) object tree.

This function creates a NamespaceElement object for each definitions.GObjects.GObj in the object.

get_namespace_object(self)

Return the namespace object that mirrors this object in the action/trigger namespace.

__add_children(self, children, namespace_object, global_namespace, namespace_prefix)

Create child namespace objects according to child XML objects

Instance Variable Details

_triggerFunctions

Dictionary defining the functions this object should present in action/trigger code. Keys in this dictionary are the function names how they should be visible in the action/trigger code. Values are dictionaries, where the key 'function' contains the method to call, and the key 'global' can be set to True to make this a global function.

_triggerGet

Can be set to a method that returns the string value of the object. In action/trigger code, "str(object)" will implicitly call this function.

_triggerGlobal

If set to True, this object is added to the global namespace. Otherwise, the object is only available as a property of its parent object.

_triggerProperties

Dictionary defining the properties this object should present in action/trigger code. Keys in this dictionary are the property names how they should be visible in action/trigger code. Values are dictionaries, where the key 'get' contains the method used to read the property, and the key 'set' optionally contains the method used to set the property. Properties with no 'set' key are read only properties.

_triggerSet

Can be set to a method that sets the value of this object. In action/trigger code, "parent.object = 'foo' will implicitly call this function.


GNUe Home

Private API

Developer's Corner