| Home | Trees | Index | Help |
|---|
GTriggerCore--+ |object--+ | | |ParserObj--+ | GObj
BaseObj,
Color,
GCondition,
GDataSource,
GRDefault,
GRLayout,
GRLayoutElement,
GRootObj,
GRParameter,
GRParameters,
GRReport,
GRSortColumn,
GRSortOption,
GRSortOptions,
GRSources,
Styles,
StyleSet,
TextStyleThe base class for almost all GNUe objects. GObj based objects can be represented by XML tags in a GParser based setup. This class introduces the concept of phased initialization as well as dictionary style access.
This is the method of attribute access used by Designer and Reports. For example. if foo is a GObject, then the following are equivalent:foo.required = 'Y' foo['required'] = 'Y'The advantage of this method, however, is when namespaces are used in the GObj XML document (i.e., reports). e.g., :
foo['Char:x'] = 1 foo['Char:y'] = 2
These don't have a clean equivalent using the .attribute method. (Though, technically, a tool could access foo.Char__x, but that should be considered bad style.)
Eventually, .attribute style access should probably be deprecated, so we can clean up the python namespaces of GObjects. (i.e., we could keep all XML-storable attributes in one dict instead of in the namespace __dict__.| Method Summary | |
|---|---|
Initialize a GTriggerCore instance. | |
__getitem__(self,
key)
| |
__setitem__(self,
key,
value)
| |
Dumps an XML representation of the object | |
This is a convenience function for applications NOT using GParser to load an object tree. | |
A convenience function for applications NOT using GParser to load an object tree. | |
| string |
Returns the xml tag to be used to represent the object. |
Return a python iterator of child objects. | |
maxInits returns the maximum size of all the _inits list from this object or it's children | |
Starts GNUe's phased initialization system from this object down. | |
A recusive function to print an indented text representation of the GObj tree from this object down. | |
Function that recursively walks down through a tree of ParserObj instances and applies a function
to them. | |
The function passed to the tree walker to extract the length of the _inits list. | |
This function is called after the parsers have completely constructed. | |
Used internally by phaseInit to walk through the object tree initializing objects. | |
This bit of nastiness is here to let GNUe Designer capture the setting of GObject properties. | |
| Inherited from GTriggerCore | |
| |
Construct a namespace object tree from an XML ( definitions.GObjects.GObj) object tree. | |
Return the namespace object that mirrors this object in the action/trigger namespace. | |
| Inherited from ParserObj | |
Set the action attribute of a given object to the specified action. | |
Get the contents of this object. | |
Return a compareable and identifying id of an object within a tree. | |
Set attributes loaded by GParser. | |
Add an object to the list of children | |
Assign all attributes from a given object to this one. | |
Build an object tree representing the difference between two object trees. | |
Return a XML representation of the object. | |
Moves downward though the children of an object till it finds the child with the specified name. | |
Moves downward through the children of an object till it finds the child of the specified type. | |
Find all children of a specific type. | |
Moves upward though the parents of an object till it finds the parent of the specified type. | |
Returns the content of any GContent objects that are children of this object. | |
Return a useful description of the object. | |
| any |
Returns the immediate parent of an object instance in a GObj tree. |
Merge another object tree into this tree. | |
Set the immediate parent of an object instance in a GObj tree | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
Return hash(x)... | |
Return a new object with type S, a subtype of T... | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
Return str(x)... | |
| Instance Variable Summary | |
|---|---|
| Inherited from GTriggerCore | |
_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,
*args,
**parms)
Initialize a GTriggerCore instance.
|
__getitem__(self,
key)
|
__setitem__(self,
key,
value)
|
_dumpXML_(self, lookupDict, treeDump, gap, xmlnamespaces, textEncoding, stripPrefixes, escape)Dumps an XML representation of the object |
buildAndInitObject(self, **params)This is a convenience function for applications NOT using GParser to load an object tree. |
buildObject(self, **params)A convenience function for applications NOT using GParser to load an object tree. |
getXmlTag(self, stripPrefixes=None)Returns the xml tag to be used to represent the object.
|
iterator(self, test=None, types=(), includeSelf=True)Return a python iterator of child objects.
|
maxInits(self)maxInits returns the maximum size of all the _inits list from this object or it's children |
phaseInit(self, iterations=0)Starts GNUe's phased initialization system from this object down. Typically called from within a GParser instance. phaseInit interates thru the GObj tree as many times as necessary to fully initialize the tree. It determines the number of iterations to perform during it's first pass down the tree. phaseInit looks for a private list variable called _inits that contains a list of functions to execute. Here is an example from gnue-forms GFForm object.
This list tells phase init to execute the self.primaryInit function during the first iteration of the initialization process. During the seconds pass through it does nothing on these objects. During the third pass through it executes self.secondaryInit. Some may question why we don't do all initialization logic inside the python objects __init__ functions. Frequently you may find that a parent object may need specific infomation from some of its children to properly initialize itself. This type of logic cannot be places into an __init__ as the children may not be loaded yet or may not yet have the needed information.
|
showTree(self, indent=0)A recusive function to print an indented text representation of the GObj tree from this object down. This is usefull for debugging purposes.
|
walk(self, function, *args, **parms)Function that recursively walks down through a tree ofParserObj instances and applies a
function to them.
|
__maxInitsWalker(self, object)The function passed to the tree walker to extract the length of the _inits list.
|
_buildObject(self)This function is called after the parsers have completely constructed. All children should be in place and attributes and content should be set at this point. Return the number of phaseInit iterations your object will need. NOTE: Do not initialize datasources, etc at this point. This is only so content can be set, etc, after loading from XML.
|
_phaseInit(self, phase)Used internally by phaseInit to walk through the object tree initializing objects. |
_setItemHook(self, key, value)This bit of nastiness is here to let GNUe Designer capture the setting of GObject properties. This is primarily used in the wizard system so Designer can act in real time as a wizard sets a document's properties. I.e., if a wizard sets:field['width'] = 10Designer can immediately changed the visual width of the field as displayed on screen. |
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Tue Jan 6 23:04:09 2009 | http://epydoc.sf.net |