commit-gnue
[Top][All Lists]
Advanced

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

gnue/common etc/sample.gnue.conf src/GConfig.py...


From: Jason Cater
Subject: gnue/common etc/sample.gnue.conf src/GConfig.py...
Date: Tue, 15 Jan 2002 17:51:41 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/01/15 17:51:41

Modified files:
        common/etc     : sample.gnue.conf 
        common/src     : GConfig.py GConnections.py 
        common/src/dbdrivers/_pgsql: DBdriver.py 

Log message:
        fixed issue with GConfig

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/etc/sample.gnue.conf.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GConfig.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GConnections.py.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/dbdrivers/_pgsql/DBdriver.py.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: gnue/common/etc/sample.gnue.conf
diff -c gnue/common/etc/sample.gnue.conf:1.11 
gnue/common/etc/sample.gnue.conf:1.12
*** gnue/common/etc/sample.gnue.conf:1.11       Tue Jan  8 17:16:32 2002
--- gnue/common/etc/sample.gnue.conf    Tue Jan 15 17:51:41 2002
***************
*** 111,116 ****
--- 111,122 ----
  borderPercentage = 100
  textPercentage = 100
  
+ 
+ #[designer]
+ AutoConnect = 1
+ ColorizeCode = 0
+ 
+ 
  [navigator]
  disableSplash = 1
  ProcessDir = processes
Index: gnue/common/src/GConfig.py
diff -c gnue/common/src/GConfig.py:1.7 gnue/common/src/GConfig.py:1.8
*** gnue/common/src/GConfig.py:1.7      Fri Nov  2 18:00:29 2001
--- gnue/common/src/GConfig.py  Tue Jan 15 17:51:41 2002
***************
*** 42,65 ****
  
  _OPTION = {}
  
! class _NOOPTION: 
    pass
  
  def get(varName, default=_NOOPTION):
    global _OPTION
!   if hasattr(_OPTION, string.lower(varName)) or default == _NOOPTION: 
      return _OPTION[string.lower(varName)]
!   else: 
      return default
  
  class InvalidFormatError (StandardError):
    # Raised if the Connections Definition File is
    # in an unreadable format.
    pass
!       
  
  class GConfig:
!   def __init__(self, application):     
  
      self._application = application
  
--- 42,66 ----
  
  _OPTION = {}
  
! class _NOOPTION:
    pass
  
  def get(varName, default=_NOOPTION):
    global _OPTION
!   if _OPTION.has_key(string.lower(varName)) or default == _NOOPTION:
      return _OPTION[string.lower(varName)]
!   else:
!     GDebug.printMesg(1,"Returning default value %s for %s" % (varName, 
default))
      return default
  
  class InvalidFormatError (StandardError):
    # Raised if the Connections Definition File is
    # in an unreadable format.
    pass
! 
  
  class GConfig:
!   def __init__(self, application):
  
      self._application = application
  
***************
*** 69,96 ****
      GDebug.printMesg(1,'Reading basic configuration')
      if os.environ.has_key('INSTALL_PREFIX'):
        location = os.environ['INSTALL_PREFIX']+'/etc/gnue.conf'
!       try: 
          self.readConfig(location)
          _success = TRUE
!       except: 
          GDebug.printMesg (1,'File not available')
  
      GDebug.printMesg(1,'Reading user configuration overrides')
      if os.environ.has_key('HOME'):
        location = os.environ['HOME']+'/.gnue/gnue.conf'
!       try: 
          self.readConfig(location)
          _success = TRUE
!       except: 
          GDebug.printMesg (1,'File not available')
  
      GDebug.printMesg(1,'Reading fixed system configuration')
      if os.environ.has_key('INSTALL_PREFIX'):
        location = os.environ['INSTALL_PREFIX']+'/etc/gnue.conf.fixed'
!       try: 
          self.readConfig(location)
          _success = TRUE
!       except: 
          GDebug.printMesg (1,'File not available')
  
      if not _success:
--- 70,97 ----
      GDebug.printMesg(1,'Reading basic configuration')
      if os.environ.has_key('INSTALL_PREFIX'):
        location = os.environ['INSTALL_PREFIX']+'/etc/gnue.conf'
!       try:
          self.readConfig(location)
          _success = TRUE
!       except:
          GDebug.printMesg (1,'File not available')
  
      GDebug.printMesg(1,'Reading user configuration overrides')
      if os.environ.has_key('HOME'):
        location = os.environ['HOME']+'/.gnue/gnue.conf'
!       try:
          self.readConfig(location)
          _success = TRUE
!       except:
          GDebug.printMesg (1,'File not available')
  
      GDebug.printMesg(1,'Reading fixed system configuration')
      if os.environ.has_key('INSTALL_PREFIX'):
        location = os.environ['INSTALL_PREFIX']+'/etc/gnue.conf.fixed'
!       try:
          self.readConfig(location)
          _success = TRUE
!       except:
          GDebug.printMesg (1,'File not available')
  
      if not _success:
***************
*** 102,124 ****
          print os.environ['HOME']+'/.gnue/gnue.conf'
        if os.environ.has_key('INSTALL_PREFIX'):
          print os.environ['INSTALL_PREFIX']+'/etc/gnue.conf.fixed'
!       sys.exit("Missing GNUe config file")        
!       
  
    def readConfig(self,location):
      global _OPTION
      self._parser = GConfigParser()
!     
      GDebug.printMesg(1,'Configuration File: "%s"' % location)
!     drive = os.path.splitdrive(location) 
  
      fileHandle = openResource(location)
  
!     try: 
!       self._parser.readfp(fileHandle) 
!     except DuplicateSectionError: 
        raise InvalidFormatError, 'The file has duplicate source definitions.'
!     except MissingSectionHeaderError: 
        raise InvalidFormatError, 'The file has no source definitions.'
      except:
        print'The file cannot be parsed. %s :: %s' % (sys.exc_type, 
sys.exc_value)
--- 103,125 ----
          print os.environ['HOME']+'/.gnue/gnue.conf'
        if os.environ.has_key('INSTALL_PREFIX'):
          print os.environ['INSTALL_PREFIX']+'/etc/gnue.conf.fixed'
!       sys.exit("Missing GNUe config file")
! 
  
    def readConfig(self,location):
      global _OPTION
      self._parser = GConfigParser()
! 
      GDebug.printMesg(1,'Configuration File: "%s"' % location)
!     drive = os.path.splitdrive(location)
  
      fileHandle = openResource(location)
  
!     try:
!       self._parser.readfp(fileHandle)
!     except DuplicateSectionError:
        raise InvalidFormatError, 'The file has duplicate source definitions.'
!     except MissingSectionHeaderError:
        raise InvalidFormatError, 'The file has no source definitions.'
      except:
        print'The file cannot be parsed. %s :: %s' % (sys.exc_type, 
sys.exc_value)
***************
*** 127,133 ****
      for option in self._parser.options(self._application):
        _OPTION[option] =  self._parser.get(self._application,option)
  
!       
  
  
  
--- 128,135 ----
      for option in self._parser.options(self._application):
        _OPTION[option] =  self._parser.get(self._application,option)
  
! 
! 
  
  
  
Index: gnue/common/src/GConnections.py
diff -c gnue/common/src/GConnections.py:1.26 
gnue/common/src/GConnections.py:1.27
*** gnue/common/src/GConnections.py:1.26        Sun Nov 11 16:11:28 2001
--- gnue/common/src/GConnections.py     Tue Jan 15 17:51:41 2002
***************
*** 195,201 ****
            # We're done!
            attempts = 0
            self._loginHandler.destroyLoginDialog()
!           
          except GDataObjects.LoginError, error:
            # Oops, they must have entered an invalid user/password.
            # Those silly users.
--- 195,201 ----
            # We're done!
            attempts = 0
            self._loginHandler.destroyLoginDialog()
! 
          except GDataObjects.LoginError, error:
            # Oops, they must have entered an invalid user/password.
            # Those silly users.
Index: gnue/common/src/dbdrivers/_pgsql/DBdriver.py
diff -c gnue/common/src/dbdrivers/_pgsql/DBdriver.py:1.5 
gnue/common/src/dbdrivers/_pgsql/DBdriver.py:1.6
*** gnue/common/src/dbdrivers/_pgsql/DBdriver.py:1.5    Thu Jan 10 15:59:17 2002
--- gnue/common/src/dbdrivers/_pgsql/DBdriver.py        Tue Jan 15 17:51:41 2002
***************
*** 144,153 ****
      cursor.execute(statement)
  
      rs = cursor.fetchone()
!     schema = GDataObjects.Schema(attrs={'id':rs[2], 'name':rs[0],
!                          'type':rs[1] == 'v' and 'view' or 'table'},
!                          getChildSchema=self.__getFieldSchema)
! 
      cursor.close()
      return schema
  
--- 144,156 ----
      cursor.execute(statement)
  
      rs = cursor.fetchone()
!     if rs:
!       schema = GDataObjects.Schema(attrs={'id':rs[2], 'name':rs[0],
!                            'type':rs[1] == 'v' and 'view' or 'table'},
!                            getChildSchema=self.__getFieldSchema)
!     else:
!       schema = None
!       
      cursor.close()
      return schema
  



reply via email to

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