commit-gnue
[Top][All Lists]
Advanced

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

gnue/common/src GBaseApp.py


From: Arturas Kriukovas
Subject: gnue/common/src GBaseApp.py
Date: Tue, 30 Apr 2002 13:23:26 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Arturas Kriukovas <address@hidden>      02/04/30 13:23:26

Modified files:
        common/src     : GBaseApp.py 

Log message:
        Prepared for i18n.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GBaseApp.py.diff?tr1=1.13&tr2=1.14&r1=text&r2=text

Patches:
Index: gnue/common/src/GBaseApp.py
diff -c gnue/common/src/GBaseApp.py:1.13 gnue/common/src/GBaseApp.py:1.14
*** gnue/common/src/GBaseApp.py:1.13    Tue Apr 23 19:25:24 2002
--- gnue/common/src/GBaseApp.py Tue Apr 30 13:23:26 2002
***************
*** 39,44 ****
--- 39,45 ----
  import GConnections
  import GConfig
  import ConfigParser
+ import GImport
  
  class GBaseApp:
  
***************
*** 72,109 ****
      #        argument follows option?, argument name, help message]
      self._base_options = [
           [ 'version',None,'version',0,0, None,
!            'Displays the version information for this program.' ],
           [ 'debug_level',None,'debug-level',1,0, "level",
!            'Enables debugging messages.  Argument specifies the ' + \
!            'level of messages to display (e.g., "--debug-level 5" displays ' 
+ \
!            'all debugging messages at level 5 or below.)' ],
           [ 'debug_file',None,'debug-file',1,None, "file",
!            'Sends all debugging messages to a specified file ' + \
!            '(e.g., "--debug-file trace.log" sends all output to "trace.log")' 
],
           [ 'connections', None, 'connections', 1, None, "loc",
!            'Specifies the location of the connection definition file. ' + \
!            '<loc> may specify a file name ' + \
!            '(/usr/local/gnue/etc/connections.conf), ' + \
!            'or a URL location ' + \
!            '(http://localhost/connections.conf). '+ \
!            'If this option is not specified, the environent variable ' + \
!            'GNUE_CONNECTIONS is checked.' ],
           [ 'help', None, 'help', 0, None, None,
!            'Displays this help screen.' ],
           [ 'profile', None, 'profile', 0, None, None,
!            "Run Python's built-in profiler and display the resulting " + \
!            "run statistics." ],
           [ 'debugger', None, 'interactive-debugger', 0, None, None,
!            "Run the app inside Python's built-in debugger "],
      ]
  
      # Python version check
      try:
        if sys.hexversion < 0x02000000:
!         self.handleStartupError ('This application requires Python 2.0 or 
greater.  You are running Python %s' % sys.version[:5])
      except AttributeError:
        # Really, really old version of Python...
!       self.handleStartupError ('This application requires Python 2.0 or 
greater.')
  
  
      #
--- 73,110 ----
      #        argument follows option?, argument name, help message]
      self._base_options = [
           [ 'version',None,'version',0,0, None,
!            _('Displays the version information for this program.') ],
           [ 'debug_level',None,'debug-level',1,0, "level",
!            _('Enables debugging messages.  Argument specifies the ') + \
!            _('level of messages to display (e.g., "--debug-level 5" displays 
') + \
!            _('all debugging messages at level 5 or below.)') ],
           [ 'debug_file',None,'debug-file',1,None, "file",
!            _('Sends all debugging messages to a specified file ') + \
!            _('(e.g., "--debug-file trace.log" sends all output to 
"trace.log")') ],
           [ 'connections', None, 'connections', 1, None, "loc",
!            _('Specifies the location of the connection definition file. ') + \
!            _('<loc> may specify a file name ') + \
!            _('(/usr/local/gnue/etc/connections.conf), ') + \
!            _('or a URL location ') + \
!            _('(http://localhost/connections.conf). ')+ \
!            _('If this option is not specified, the environent variable ') + \
!            _('GNUE_CONNECTIONS is checked.') ],
           [ 'help', None, 'help', 0, None, None,
!            _('Displays this help screen.') ],
           [ 'profile', None, 'profile', 0, None, None,
!            _("Run Python's built-in profiler and display the resulting ") + \
!            _("run statistics.") ],
           [ 'debugger', None, 'interactive-debugger', 0, None, None,
!            _("Run the app inside Python's built-in debugger ")],
      ]
  
      # Python version check
      try:
        if sys.hexversion < 0x02000000:
!         self.handleStartupError (_('This application requires Python 2.0 or 
greater.  You are running Python %s') % sys.version[:5])
      except AttributeError:
        # Really, really old version of Python...
!       self.handleStartupError (_('This application requires Python 2.0 or 
greater.'))
  
  
      #
***************
*** 158,164 ****
        GDebug.setDebug(int("%s" % self.OPTIONS['debug_level']),
            self.OPTIONS['debug_file'])
      except ValueError:
!       self.handleStartupError('The debug_level option ("-d") expects a 
numerical value.')
  
          
      
--- 159,165 ----
        GDebug.setDebug(int("%s" % self.OPTIONS['debug_level']),
            self.OPTIONS['debug_file'])
      except ValueError:
!       self.handleStartupError(_('The debug_level option ("-d") expects a 
numerical value.'))
  
          
      
***************
*** 171,183 ****
        try:
          GConfig.GConfig(application)
        except ConfigParser.NoSectionError, msg:
!         self.handleStartupError('The gnue.conf file is incomplete: '\
                                  + '\n   %s'         % msg)
        except Exception, msg:
          type=string.splitfields(str(sys.exc_type),'.')
          type.reverse()
          self.handleStartupError( \
!           '%s while reading gnue.conf: ' % type[0] \
            + '\n   %s'         % msg)
  
      # Get the connection definitions
--- 172,184 ----
        try:
          GConfig.GConfig(application)
        except ConfigParser.NoSectionError, msg:
!         self.handleStartupError(_('The gnue.conf file is incomplete: ')\
                                  + '\n   %s'         % msg)
        except Exception, msg:
          type=string.splitfields(str(sys.exc_type),'.')
          type.reverse()
          self.handleStartupError( \
!           _('%s while reading gnue.conf: ') % type[0] \
            + '\n   %s'         % msg)
  
      # Get the connection definitions
***************
*** 192,200 ****
        else:
          self.connections_file = "" # temp
  #        self.handleStartupError(
! #            'Unable to load the connections definition file.\n' \
! #            + '\n   Please set the environmental variable GNUE_CONNECTIONS 
or ' \
! #            + '\n   use the "-f" command option.')
  
        GDebug.printMesg(1, 'Connection Definition: "%s"' % 
self.connections_file)
  
--- 193,201 ----
        else:
          self.connections_file = "" # temp
  #        self.handleStartupError(
! #            _('Unable to load the connections definition file.\n') \
! #            + _('\n   Please set the environmental variable GNUE_CONNECTIONS 
or ') \
! #            + _('\n   use the "-f" command option.'))
  
        GDebug.printMesg(1, 'Connection Definition: "%s"' % 
self.connections_file)
  
***************
*** 202,217 ****
          self.connections = GConnections.GConnections(self.connections_file)
        except GConnections.InvalidFormatError, msg:
          self.handleStartupError(
!             'Unable to load the connections definition file.\n' \
!             + '\n   The connections file is in an invalid format. ' \
!             + '\n   %s' \
                 % msg)
        except IOError:
          self.handleStartupError(
!              'Unable to load the connections definition file.\n' \
!              + '\n   The connections file specified either does ' \
!              + '\n   not exist or is not readable by your account.\n' \
!              + '\n   Location: "%s"'
                  % self.connections_file)
  
    #
--- 203,218 ----
          self.connections = GConnections.GConnections(self.connections_file)
        except GConnections.InvalidFormatError, msg:
          self.handleStartupError(
!             _('Unable to load the connections definition file.\n') \
!             + _('\n   The connections file is in an invalid format. ') \
!             + _('\n   %s') \
                 % msg)
        except IOError:
          self.handleStartupError(
!              _('Unable to load the connections definition file.\n') \
!              + _('\n   The connections file specified either does ') \
!              + _('\n   not exist or is not readable by your account.\n') \
!              + _('\n   Location: "%s"')
                  % self.connections_file)
  
    #
***************
*** 276,284 ****
        dispOptions = dispOptions + "\n"
  
      self.printVersion()
!     print "Usage:  %s\n\n%s\n\nAvailable command line options:\n%s" % \
         (self.USAGE, self.SUMMARY, dispOptions)
!     print "Report bugs to address@hidden"
  
  
    #
--- 277,285 ----
        dispOptions = dispOptions + "\n"
  
      self.printVersion()
!     print _("Usage:  %s\n\n%s\n\nAvailable command line options:\n%s") % \
         (self.USAGE, self.SUMMARY, dispOptions)
!     print _("Report bugs to address@hidden")
  
  
    #
***************
*** 291,300 ****
        # if msg is multiline, then surround with dashes to set it apart
        if string.find("%s" % msg, "\n") + 1:
          print '-' * 60
!       print "Error: %s" % msg
        if string.find("%s" % msg, "\n") + 1:
          print '-' * 60
!       print "\nFor help, type:\n   %s --help\n" % (self.COMMAND)
        sys.exit()
  
    #
--- 292,301 ----
        # if msg is multiline, then surround with dashes to set it apart
        if string.find("%s" % msg, "\n") + 1:
          print '-' * 60
!       print _("Error: %s") % msg
        if string.find("%s" % msg, "\n") + 1:
          print '-' * 60
!       print _("\nFor help, type:\n   %s --help\n") % (self.COMMAND)
        sys.exit()
  
    #



reply via email to

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