commit-gnue
[Top][All Lists]
Advanced

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

r6324 - trunk/gnue-forms/src


From: johannes
Subject: r6324 - trunk/gnue-forms/src
Date: Fri, 17 Sep 2004 05:16:27 -0500 (CDT)

Author: johannes
Date: 2004-09-17 05:16:26 -0500 (Fri, 17 Sep 2004)
New Revision: 6324

Modified:
   trunk/gnue-forms/src/GFClient.py
   trunk/gnue-forms/src/GFInstance.py
Log:
Be nice and raise exceptions using unicode messages


Modified: trunk/gnue-forms/src/GFClient.py
===================================================================
--- trunk/gnue-forms/src/GFClient.py    2004-09-17 09:58:53 UTC (rev 6323)
+++ trunk/gnue-forms/src/GFClient.py    2004-09-17 10:16:26 UTC (rev 6324)
@@ -152,7 +152,7 @@
                                     'install_prefix'),
           gConfigForms ('FormDir'), basename + ".gfd")
       else:
-        raise StartupError, _("No Forms Definition File Specified.")
+        raise StartupError, u_("No Forms Definition File Specified.")
 
     instance.addFormFromFile (formfile)
     instance.addDialogs ()

Modified: trunk/gnue-forms/src/GFInstance.py
===================================================================
--- trunk/gnue-forms/src/GFInstance.py  2004-09-17 09:58:53 UTC (rev 6323)
+++ trunk/gnue-forms/src/GFInstance.py  2004-09-17 10:16:26 UTC (rev 6324)
@@ -56,7 +56,7 @@
 
 class FileOpenError (StartupError):
   def __init__ (self, message):
-    msg = u_("Unable to open file\n%s") % message
+    msg = u_("Unable to open file: %s") % message
     StartupError.__init__ (self, msg)
 
 
@@ -217,8 +217,8 @@
       self.addFormFromFilehandle (fileHandle)
       fileHandle.close ()
 
-    except IOError, mesg:
-      raise FileOpenError, mesg
+    except IOError:
+      raise FileOpenError, errors.getException () [2]
 
 
   # ---------------------------------------------------------------------------
@@ -243,8 +243,8 @@
       self.addFormFromFilehandle (fileHandle)
       fileHandle.close ()
 
-    except IOError, mesg:
-      raise FileOpenError, mesg
+    except IOError:
+      raise FileOpenError, errors.getException () [2]
 
 
   # ---------------------------------------------------------------------------
@@ -297,13 +297,14 @@
       for formObject in self._formsDictionary.values ():
         formObject.phaseInit ()
 
-    except GDataObjects.ConnectError, mesg:
+    except GDataObjects.ConnectError:
       raise StartupError, \
-        u_("Unable to login to datasource.\n\n       %s") % mesg
+          u_("Unable to login to datasource: %s") % errors.getException () [2]
 
-    except GDataObjects.ConnectionError, mesg:
+    except GDataObjects.ConnectionError:
       raise StartupError, \
-        u_("Error while communicating with datasource.\n\n       %s") % mesg
+          u_("Error while communicating with datasource: %s") \
+          % errors.getException () [2]
 
     self._uiinstance.initialize ()
 
@@ -330,7 +331,7 @@
 
     if not form._currentEntry:
       raise errors.ApplicationError, \
-         _("There are no navigable widgets in this form. Unable to display.")
+         u_("There are no navigable widgets in this form. Unable to display.")
 
     form.processTrigger ('On-Activation')
 





reply via email to

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