commit-gnue
[Top][All Lists]
Advanced

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

r6771 - trunk/gnue-common/src/definitions


From: johannes
Subject: r6771 - trunk/gnue-common/src/definitions
Date: Wed, 1 Dec 2004 03:47:25 -0600 (CST)

Author: johannes
Date: 2004-12-01 03:47:25 -0600 (Wed, 01 Dec 2004)
New Revision: 6771

Modified:
   trunk/gnue-common/src/definitions/GParser.py
Log:
Support for _instance and _app style instances on load


Modified: trunk/gnue-common/src/definitions/GParser.py
===================================================================
--- trunk/gnue-common/src/definitions/GParser.py        2004-12-01 09:36:22 UTC 
(rev 6770)
+++ trunk/gnue-common/src/definitions/GParser.py        2004-12-01 09:47:25 UTC 
(rev 6771)
@@ -469,8 +469,18 @@
      # Open the library and convert it into objects
      #
      handle = openResource(self.library)
-     form = self._xmlParser.loadFile(handle, self.findParentOfType(None)._app, 
initialize=0)
-     handle.close()
+     parent = self.findParentOfType (None)
+
+     # Let the parent provide it's instance either as _app or _instance
+     if hasattr (parent, '_instance'):
+       instance = parent._instance
+     elif hasattr (parent, '_app'):
+       instance = parent._app
+     else:
+       instance = None
+
+     form = self._xmlParser.loadFile (handle, instance, initialize = 0)
+     handle.close ()
      id = 'id'
      if hasattr(self,'name'):
          id = 'name'





reply via email to

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