[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/gnue-common gnue/common/GClientApp.py gnue...
From: |
James Thompson |
Subject: |
gnue/gnue-common gnue/common/GClientApp.py gnue... |
Date: |
Mon, 04 Jun 2001 20:23:39 -0700 |
CVSROOT: /cvs
Module name: gnue
Changes by: James Thompson <address@hidden> 01/06/04 20:23:39
Modified files:
gnue-common/gnue/common: GClientApp.py GConnections.py
gnue-common/gnue/common/dbdrivers/postgresql: DBdriver.py
Added files:
gnue-common/etc: sample.gnue.conf
gnue-common/gnue/common: GConfig.py GConfigParser.py
Log message:
Added GConfig code to provide configuration system
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/etc/sample.gnue.conf?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/gnue/common/GConfig.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/gnue/common/GConfigParser.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/gnue/common/GClientApp.py.diff?cvsroot=OldCVS&tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/gnue/common/GConnections.py.diff?cvsroot=OldCVS&tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/gnue/common/dbdrivers/postgresql/DBdriver.py.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: gnue/gnue-common/gnue/common/GClientApp.py
diff -u gnue/gnue-common/gnue/common/GClientApp.py:1.8
gnue/gnue-common/gnue/common/GClientApp.py:1.9
--- gnue/gnue-common/gnue/common/GClientApp.py:1.8 Fri Jun 1 12:56:06 2001
+++ gnue/gnue-common/gnue/common/GClientApp.py Mon Jun 4 20:23:39 2001
@@ -35,8 +35,8 @@
import string
import os
import GConnections
+import GConfig
-
class GClientApp:
# Attributes to be overwritten by subclasses
@@ -61,9 +61,8 @@
-
- def __init__(self, connections=None):
+ def __init__(self, connections=None, application=None):
# format of COMMAND_OPTIONS and _base_options:
# [option, option] where option is:
# [dictionary key name, short option, long option,
@@ -144,7 +143,10 @@
GDebug.printMesg(1,"Run Options: %s" % opt)
GDebug.printMesg(1,"Run Arguments: %s" % self.ARGUMENTS)
-
+ # Read the config files
+ if application:
+ GConfig.GConfig(application)
+
# Get the connection definitions
if connections != None:
self.connections = Connections
Index: gnue/gnue-common/gnue/common/GConnections.py
diff -u gnue/gnue-common/gnue/common/GConnections.py:1.5
gnue/gnue-common/gnue/common/GConnections.py:1.6
--- gnue/gnue-common/gnue/common/GConnections.py:1.5 Fri May 25 01:03:01 2001
+++ gnue/gnue-common/gnue/common/GConnections.py Mon Jun 4 20:23:39 2001
@@ -30,7 +30,7 @@
# HISTORY:
#
-from ConfigParser import *
+from GConfigParser import *
import os
import os.path
import urllib
@@ -56,18 +56,19 @@
def __init__(self, location, loginHandler=None):
self._loginHandler = loginHandler
+ self._parser = GConfigParser()
- #
- # This is an ugly hack to make the Python 1.5.2 ConfigParser
- # support reading its data from a file handle. Later versions
- # have a readfp method. :(
- #
- if (not ConfigParser.__dict__.has_key('readfp') and
- ConfigParser.__dict__.has_key('_ConfigParser__read')):
- GDebug.printMesg(1,'Subclassing ConfigParser to support URL''s')
- self._parser = _ConfigParser()
- else:
- self._parser = ConfigParser()
+## #
+## # This is an ugly hack to make the Python 1.5.2 ConfigParser
+## # support reading its data from a file handle. Later versions
+## # have a readfp method. :(
+## #
+## if (not ConfigParser.__dict__.has_key('readfp') and
+## ConfigParser.__dict__.has_key('_ConfigParser__read')):
+## GDebug.printMesg(1,'Subclassing ConfigParser to support URL''s')
+## self._parser = _ConfigParser()
+## else:
+## self._parser = ConfigParser()
GDebug.printMesg(1,'Conn File: "%s"' % location)
drive = os.path.splitdrive(location)
@@ -203,9 +204,9 @@
# support reading its data from a file handle. Later versions
# have a readfp method. :(
#
-class _ConfigParser(ConfigParser):
- def readfp (self, fp):
- self.__read(fp)
+#class _ConfigParser(ConfigParser):
+# def readfp (self, fp):
+# self.__read(fp)
Index: gnue/gnue-common/gnue/common/dbdrivers/postgresql/DBdriver.py
diff -u gnue/gnue-common/gnue/common/dbdrivers/postgresql/DBdriver.py:1.3
gnue/gnue-common/gnue/common/dbdrivers/postgresql/DBdriver.py:1.4
--- gnue/gnue-common/gnue/common/dbdrivers/postgresql/DBdriver.py:1.3 Tue May
29 19:20:57 2001
+++ gnue/gnue-common/gnue/common/dbdrivers/postgresql/DBdriver.py Mon Jun
4 20:23:39 2001
@@ -95,7 +95,7 @@
class PG_DataObject(DBSIG_DataObject):
def __init__(self):
DBSIG_DataObject.__init__(self)
- self._DatabaseError = pgdb.DatabaseError
+ self._DatabaseError = pg.DatabaseError
#### When the PyGreSQL's .fetchone() bug is fixed, delete following line
self._resultSetClass = PG_ResultSet
@@ -103,7 +103,7 @@
def connect(self, connectData={}):
GDebug.printMesg(1,"Postgresql database driver initializing")
try:
- self._dataConnection = pgdb.connect(user=connectData['_username'],
+ self._dataConnection = pg.connect(user=connectData['_username'],
password=connectData['_password'],
host=connectData['host'],
database=connectData['dbname'])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/gnue-common gnue/common/GClientApp.py gnue...,
James Thompson <=