commit-gnue
[Top][All Lists]
Advanced

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

r6166 - trunk/gnue-forms/src


From: johannes
Subject: r6166 - trunk/gnue-forms/src
Date: Fri, 6 Aug 2004 13:30:02 -0500 (CDT)

Author: johannes
Date: 2004-08-06 13:30:01 -0500 (Fri, 06 Aug 2004)
New Revision: 6166

Modified:
   trunk/gnue-forms/src/GFInstance.py
Log:
Added support of appserver:// style url's


Modified: trunk/gnue-forms/src/GFInstance.py
===================================================================
--- trunk/gnue-forms/src/GFInstance.py  2004-08-06 18:29:25 UTC (rev 6165)
+++ trunk/gnue-forms/src/GFInstance.py  2004-08-06 18:30:01 UTC (rev 6166)
@@ -40,8 +40,10 @@
 from gnue.forms.GFParser import loadFile
 from gnue.forms import VERSION
 from gnue.forms import GFKeyMapper
-from gnue.common.apps import GDebug
+from gnue.common.apps import GDebug, i18n
 from gnue.common.datasources import GDataObjects, GConnections
+from gnue.common.datasources.Exceptions import LoginError
+from gnue.common.datasources.GDataSource import getAppserverResource
 from gnue.common import events
 from gnue.common.utils.FileUtils import dyn_import
 from gnue.common.utils.FileUtils import openResource, openBuffer
@@ -195,12 +197,24 @@
     @param fileName: A string containing a URI
     """
     try:
-      fileHandle=openResource(fileName)
+      if fileName [:12] == 'appserver://':
+        # (w, h) = self._uimodule.getMaxFormSize ()
+        param = {'language': i18n.language, 'formwidth': 80, 'formheight': 20}
+        fileHandle = getAppserverResource (fileName, param, self.connections)
+      else:
+        fileHandle=openResource(fileName)
+
       self.addFormFromFilehandle(fileHandle)
       fileHandle.close()
+
+
     except IOError, mesg:
       self.manager.handleStartupError(_("Unable to open file\n\n     %s")%mesg)
 
+    except Exception, mesg:
+      self.manager.handleStartupError ("%s" % mesg)
+
+
   def addFormFromFilehandle(self,fileHandle):
     """
     Loads a GObj based form tree when passed a valid python file handle.
@@ -230,6 +244,7 @@
     #
     self._formsDictionary[form.name] = form
 
+
   #
   # removes the subforms from the main tree before
   # any UI stuff is constructed.





reply via email to

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