commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r8436 - trunk/gnue-common/src/datasources


From: reinhard
Subject: [gnue] r8436 - trunk/gnue-common/src/datasources
Date: Wed, 19 Apr 2006 11:03:21 -0500 (CDT)

Author: reinhard
Date: 2006-04-19 11:03:21 -0500 (Wed, 19 Apr 2006)
New Revision: 8436

Modified:
   trunk/gnue-common/src/datasources/ConnectionTriggerObj.py
Log:
Added new function to add all connections as children into an XML tree.


Modified: trunk/gnue-common/src/datasources/ConnectionTriggerObj.py
===================================================================
--- trunk/gnue-common/src/datasources/ConnectionTriggerObj.py   2006-04-19 
13:10:00 UTC (rev 8435)
+++ trunk/gnue-common/src/datasources/ConnectionTriggerObj.py   2006-04-19 
16:03:21 UTC (rev 8436)
@@ -24,7 +24,7 @@
 Wrapper object for connections to be used in trigger namespace.
 """
 
-__all__ = ['ConnectionTriggerObj']
+__all__ = ['ConnectionTriggerObj', 'add_connections_to_tree']
 
 import types
 
@@ -79,9 +79,29 @@
 # Add all connections to the namespace
 # =============================================================================
 
+def add_connections_to_tree (connections, root_object):
+    """
+    Adds a L{ConnectionTriggerObj} object for each connection as a child to the
+    root object.
+    
+    This causes all connections to become visible in the global trigger
+    namespace, because they will be handled like XML elements defined within
+    the root element.
+    """
+    for name in connections.getConnectionNames(): 
+        try: 
+            conn = connections.getConnection(name)
+        except: 
+            assert gDebug (1, "Cannot add connection %s to object tree" % name)
+            continue
+        root_object.addChild(ConnectionTriggerObj(conn, name))
+
+
+# Depreciated
+
 def addAllConnections (connections, gobjNamespace): 
   """
-  Adds all the connection names to the global trigger namespace
+  Adds all the connection names to the global trigger namespace. DEPRECIATED.
   """
 
   for name in connections.getConnectionNames (): 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]