[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r8329 - trunk/gnue-common/src/logic
From: |
reinhard |
Subject: |
[gnue] r8329 - trunk/gnue-common/src/logic |
Date: |
Mon, 3 Apr 2006 18:24:34 -0500 (CDT) |
Author: reinhard
Date: 2006-03-31 16:40:44 -0600 (Fri, 31 Mar 2006)
New Revision: 8329
Modified:
trunk/gnue-common/src/logic/GTrigger.py
Log:
Use nicer names for triggers for execution context and function name, as both
are used in error messages.
Modified: trunk/gnue-common/src/logic/GTrigger.py
===================================================================
--- trunk/gnue-common/src/logic/GTrigger.py 2006-03-31 21:27:47 UTC (rev
8328)
+++ trunk/gnue-common/src/logic/GTrigger.py 2006-03-31 22:40:44 UTC (rev
8329)
@@ -148,28 +148,36 @@
# define local trigger namespace
cx.defineNamespace (self._triggerns)
- # Build the name of an object, has to be integrated with the namespace
- # creation
- path=""
- p = self
- delim = ""
- while p:
- if hasattr (p, 'name'):
- if p.name:
- path = p.name + delim + path
- delim = "_"
- if hasattr (p, 'type'):
- if p.type:
- path = p.type + delim + path
- delim = "_"
- if p._triggerGlobal == 1:
- p=None
- else:
- p=p.getParent ()
+ # build a name for the execution context which will be helpful if displayed
+ # in error messages
+ if self.type == 'NAMED':
+ cx.shortname = "Named trigger %s" % self.name
+ else:
+ path = ""
+ p = self
+ delim = ""
+ while p:
+ if hasattr(p, 'name'):
+ if p.name:
+ path = p.name + delim + path
+ delim = "_"
+ if hasattr(p, 'type'):
+ if p.type:
+ path = p.type + delim + path
+ delim = "_"
+ if p._triggerGlobal == 1:
+ p = None
+ else:
+ p = p.getParent()
+ cx.shortname = path
- method = cx.buildFunction (path, self._text)
- self.__call__ = method
+ if self.name:
+ functionname = self.name
+ else:
+ functionname = self.type.upper()
+ self.__call__ = cx.buildFunction (functionname, self._text)
+
def dummyFunction(self, myself):
assert gDebug(1, "Trigger not implemented")
@@ -178,7 +186,6 @@
Return a useful description of this object
for use by designer
"""
- print "Type", self.type
if self.type == 'NAMED':
return self.name
else:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r8329 - trunk/gnue-common/src/logic,
reinhard <=