commit-gnue
[Top][All Lists]
Advanced

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

gnue/gnue-common/src GConfig.py


From: Jason Cater
Subject: gnue/gnue-common/src GConfig.py
Date: Fri, 06 Jul 2001 14:53:25 -0700

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    01/07/06 14:53:25

Modified files:
        gnue-common/src: GConfig.py 

Log message:
        Removed DOS line endings (oops)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GConfig.py.diff?cvsroot=OldCVS&tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: gnue/gnue-common/src/GConfig.py
diff -u gnue/gnue-common/src/GConfig.py:1.5 gnue/gnue-common/src/GConfig.py:1.6
--- gnue/gnue-common/src/GConfig.py:1.5 Sat Jun 30 11:37:32 2001
+++ gnue/gnue-common/src/GConfig.py     Fri Jul  6 14:53:25 2001
@@ -1,135 +1,135 @@
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it 
-# and/or modify it under the terms of the GNU General Public 
-# License as published by the Free Software Foundation; either 
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be 
-# useful, but WITHOUT ANY WARRANTY; without even the implied 
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public 
-# License along with program; see the file COPYING. If not, 
-# write to the Free Software Foundation, Inc., 59 Temple Place 
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Copyright 2000, 2001 Free Software Foundation
-#
-# FILE:
-# GConfig.py
-#
-# DESCRIPTION:
-# Class that loads the gnue.conf files so gnue apps can get
-# default settings. 
-#
-# NOTES:
-#
-# HISTORY:
-#
-
-from GConfigParser import * 
-import os
-from gnue.common import openResource
-import string
-import GDebug
-import GDataObjects
-import GLoginHandler
-
-TRUE = 1
-FALSE = 0
-
-_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
-
-    _success = FALSE
-
-    GDebug.printMesg(1,'Application style: %s' % self._application)
-    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:
-      print "The gnue.conf file appears to be missing\n\n" \
-           +"The file should be located in one of the following locations\n"
-      if os.environ.has_key('INSTALL_PREFIX'):
-        print os.environ['INSTALL_PREFIX']+'/etc/gnue.conf'
-      if os.environ.has_key('HOME'):
-        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)
-      raise InvalidFormatError, 'The file cannot be parsed.'
-
-    for option in self._parser.options(self._application):
-      _OPTION[option] =  self._parser.get(self._application,option)
-
-      
-
-
-
-
+#
+# This file is part of GNU Enterprise.
+#
+# GNU Enterprise is free software; you can redistribute it 
+# and/or modify it under the terms of the GNU General Public 
+# License as published by the Free Software Foundation; either 
+# version 2, or (at your option) any later version.
+#
+# GNU Enterprise is distributed in the hope that it will be 
+# useful, but WITHOUT ANY WARRANTY; without even the implied 
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public 
+# License along with program; see the file COPYING. If not, 
+# write to the Free Software Foundation, Inc., 59 Temple Place 
+# - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Copyright 2000, 2001 Free Software Foundation
+#
+# FILE:
+# GConfig.py
+#
+# DESCRIPTION:
+# Class that loads the gnue.conf files so gnue apps can get
+# default settings. 
+#
+# NOTES:
+#
+# HISTORY:
+#
+
+from GConfigParser import * 
+import os
+from gnue.common import openResource
+import string
+import GDebug
+import GDataObjects
+import GLoginHandler
+
+TRUE = 1
+FALSE = 0
+
+_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
+
+    _success = FALSE
+
+    GDebug.printMesg(1,'Application style: %s' % self._application)
+    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:
+      print "The gnue.conf file appears to be missing\n\n" \
+           +"The file should be located in one of the following locations\n"
+      if os.environ.has_key('INSTALL_PREFIX'):
+        print os.environ['INSTALL_PREFIX']+'/etc/gnue.conf'
+      if os.environ.has_key('HOME'):
+        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)
+      raise InvalidFormatError, 'The file cannot be parsed.'
+
+    for option in self._parser.options(self._application):
+      _OPTION[option] =  self._parser.get(self._application,option)
+
+      
+
+
+
+



reply via email to

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