commit-gnue
[Top][All Lists]
Advanced

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

gnue designer/src/Designer.py forms/src/GFClien...


From: Jason Cater
Subject: gnue designer/src/Designer.py forms/src/GFClien...
Date: Thu, 06 Mar 2003 14:45:40 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    03/03/06 14:45:35

Modified files:
        designer/src   : Designer.py 
        forms/src      : GFClient.py 
        forms/src/uidrivers/wx: __init__.py 
Added files:
        forms/src/uidrivers/wx: ErrorHandler.py 

Log message:
        handle startup errors using a dialog box instead of just dumping to 
screen

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/Designer.py.diff?tr1=1.66&tr2=1.67&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/GFClient.py.diff?tr1=1.66&tr2=1.67&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/uidrivers/wx/ErrorHandler.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/uidrivers/wx/__init__.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: gnue/designer/src/Designer.py
diff -c gnue/designer/src/Designer.py:1.66 gnue/designer/src/Designer.py:1.67
*** gnue/designer/src/Designer.py:1.66  Wed Mar  5 18:12:57 2003
--- gnue/designer/src/Designer.py       Thu Mar  6 14:44:54 2003
***************
*** 235,241 ****
  
      from sys import version as v
      imports.append('Python Version %s' % v.replace('\n','\n    '))
!     
  
      dlg = wxMessageDialog(NULL, self.NAME + " " +
                                  _("Version  ") + self.VERSION + "\n\n" +
--- 235,241 ----
  
      from sys import version as v
      imports.append('Python Version %s' % v.replace('\n','\n    '))
! 
  
      dlg = wxMessageDialog(NULL, self.NAME + " " +
                                  _("Version  ") + self.VERSION + "\n\n" +
Index: gnue/forms/src/GFClient.py
diff -c gnue/forms/src/GFClient.py:1.66 gnue/forms/src/GFClient.py:1.67
*** gnue/forms/src/GFClient.py:1.66     Thu Mar  6 00:00:00 2003
--- gnue/forms/src/GFClient.py  Thu Mar  6 14:45:28 2003
***************
*** 67,72 ****
--- 67,109 ----
    # Run the client application
    #
    def run(self):
+ 
+     #
+     # Initialize user interface
+     #
+     self.ui_type = self.OPTIONS['user_interface']
+     if self.ui_type:
+       SPECIFIC_UI = 1
+     else:
+       SPECIFIC_UI = 0
+       self.ui_type = gConfigForms('DefaultUI')
+ 
+     while 1:
+       try:
+         self._ui = dyn_import("gnue.forms.uidrivers.%s" % (self.ui_type))
+         break
+       except ImportError, err:
+         GDebug.printMesg(1,_("Unable to load UI driver")+" %s" % self.ui_type)
+         GDebug.printMesg(1,err)
+ 
+         # If user specified a specific UI, don't cycle...
+         if SPECIFIC_UI:
+           raise  # TODO: TEMPORARY
+           self.handleStartupError(_("Unable to load any valid UI drivers.  
Aborting.\n\nTraceback\n%s") % err)
+ 
+         if self.ui_type != 'curses':
+           self.ui_type = 'curses'
+         else:
+           self.handleStartupError(_("Unable to load any valid UI drivers.  
Aborting."))
+ 
+     if hasattr(self._ui,'handleStartupError'):
+       self.handleStartupError = self._ui.handleStartupError
+ 
+ ##    if hasattr(self._ui,'handleUncaughtException'):
+ ##      sys._orig_excepthook = sys.excepthook
+ ##      sys.excepthook = self._ui.handleUncaughtException
+ 
+ 
      #
      # assign form file from 1st free argument
      #
***************
*** 90,124 ****
      #
      userParameters = self.getCommandLineParameters(self.ARGUMENTS[1:])
  
-     #
-     # Initialize user interface 
-     # 
-     self.ui_type = self.OPTIONS['user_interface']
-     if self.ui_type:
-       SPECIFIC_UI = 1
-     else: 
-       SPECIFIC_UI = 0
-       self.ui_type = gConfigForms('DefaultUI')
- 
-     while 1:
-       try:
-         self._ui = dyn_import("gnue.forms.uidrivers.%s" % (self.ui_type))
-         break
-       except ImportError, err:
-         GDebug.printMesg(1,_("Unable to load UI driver")+" %s" % self.ui_type)
-         GDebug.printMesg(1,err)
-         
-         # If user specified a specific UI, don't cycle...
-         if SPECIFIC_UI: 
-           raise  # TODO: TEMPORARY
-         self.handleStartupError(_("Unable to load any valid UI drivers.  
Aborting.\n\nTraceback\n%s") % err)
-           sys.exit()
-         
-         if self.ui_type != 'curses':
-           self.ui_type = 'curses'
-         else:
-         self.handleStartupError(_("Unable to load any valid UI drivers.  
Aborting."))
-           sys.exit()
  
      if gConfig('disableSplash') == '1':
        self.disableSplash = 1
--- 127,132 ----
***************
*** 137,143 ****
                            connections=self.connections, ui=self._ui,
                            disableSplash=self.disableSplash,
                            parameters=userParameters)
!     
      instance.addFormFromFile(formfile)
      instance.addDialogs()
      instance.activate()
--- 145,151 ----
                            connections=self.connections, ui=self._ui,
                            disableSplash=self.disableSplash,
                            parameters=userParameters)
! 
      instance.addFormFromFile(formfile)
      instance.addDialogs()
      instance.activate()
Index: gnue/forms/src/uidrivers/wx/__init__.py
diff -c gnue/forms/src/uidrivers/wx/__init__.py:1.3 
gnue/forms/src/uidrivers/wx/__init__.py:1.4
*** gnue/forms/src/uidrivers/wx/__init__.py:1.3 Sat Mar  1 00:50:44 2003
--- gnue/forms/src/uidrivers/wx/__init__.py     Thu Mar  6 14:45:34 2003
***************
*** 1,3 ****
  from UIdriver import GFUserInterface
  from UILoginHandler import *
! 
--- 1,3 ----
  from UIdriver import GFUserInterface
  from UILoginHandler import *
! from ErrorHandler import handleStartupError, handleUncaughtException




reply via email to

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