commit-gnue
[Top][All Lists]
Advanced

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

gnue/gnue-common/src GConnections.py GDataObjec...


From: Jason Cater
Subject: gnue/gnue-common/src GConnections.py GDataObjec...
Date: Sat, 21 Jul 2001 13:50:06 -0700

CVSROOT:        /home/cvs
Module name:    gnue
Branch:         gnuef-new-datasources
Changes by:     Jason Cater <address@hidden>    01/07/21 13:50:06

Modified files:
        gnue-common/src: GConnections.py GDataObjects.py 
        gnue-common/src/dbdrivers/empty: DBdriver.py 
        gnue-common/src/dbdrivers/postgresql: DBdriver.py 

Log message:
        Fixed connect issues; added _postConnect method to dataobjects to 
account for .connect() not always getting called.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GConnections.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.9.2.2&tr2=1.9.2.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GDataObjects.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.7.2.11&tr2=1.7.2.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/empty/DBdriver.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.1.2.2&tr2=1.1.2.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.8.2.1&tr2=1.8.2.2&r1=text&r2=text

Patches:
Index: gnue/gnue-common/src/GConnections.py
diff -u gnue/gnue-common/src/GConnections.py:1.8 
gnue/gnue-common/src/GConnections.py:1.9
--- gnue/gnue-common/src/GConnections.py:1.8    Wed Jun  6 15:31:15 2001
+++ gnue/gnue-common/src/GConnections.py        Mon Jun 25 12:29:11 2001
@@ -37,12 +37,12 @@
 import GLoginHandler
 from gnue.common import openResource
 
-class NotFoundError (Error): 
+class NotFoundError (StandardError): 
   # Raised if a requested connection name does not  
   # exist in the Connections Definition File.
   pass
 
-class InvalidFormatError (Error): 
+class InvalidFormatError (StandardError): 
   # Raised if the Connections Definition File is   
   # in an unreadable format.
   pass
Index: gnue/gnue-common/src/GDataObjects.py
diff -u gnue/gnue-common/src/GDataObjects.py:1.6 
gnue/gnue-common/src/GDataObjects.py:1.7
--- gnue/gnue-common/src/GDataObjects.py:1.6    Tue May 29 19:54:11 2001
+++ gnue/gnue-common/src/GDataObjects.py        Tue Jun  5 08:57:45 2001
@@ -127,8 +127,8 @@
     criteria = {}
     for i in range(0, len(self._masterfields)): 
       GDebug.printMesg(10,"Adding criteria")
-      criteria[string.trim(self._detailfields[i])] = \
-          master.current.getField(string.trim(self._masterfields[i]))
+      criteria[string.strip(self._detailfields[i])] = \
+          master.current.getField(string.strip(self._masterfields[i]))
       GDebug.printMesg(10,master.current.getField(self._masterfields[i]))
     return self.createResultSet(criteria)
 
Index: gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.8 
gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.9
--- gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.8   Wed Jul  4 
17:24:11 2001
+++ gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py       Thu Jul 12 
20:56:31 2001
@@ -109,6 +109,7 @@
                    password=connectData['_password'], 
                    host=connectData['host'], 
                    database=connectData['dbname'])
+      self.triggerExtensions = TriggerExtensions(self._dataConnection)
     except self._DatabaseError, value:
       raise GDataObjects.ConnectionError, value
 
@@ -138,16 +139,44 @@
     return DBSIG_DataObject_SQL._buildQuery(self, conditions)
 
 
+#
+#  Extensions to Trigger Namespaces
+#  
+class TriggerExtensions: 
+
+  def __init__(self, connection): 
+    self.__connection = connection
+
+  # Return the current date, according to database
+#  def getDate(self): 
+#    pass
+
+  # Return a sequence number from sequence 'name' 
+#  def getSequence(self, name): 
+#    pass
+
+  # Run the SQL statement 'statement'
+#  def sql(self, statement): 
+#    pass
 
+
+
+######################################
+#
+#  The following hashes describe 
+#  this driver's characteristings.
+#
+######################################
+
+#
+#  All datasouce "types" and corresponding DataObject class
+# 
 supportedDataObjects = { 
   'object': PG_DataObject_Object,
   'sql':    PG_DataObject_SQL
 }
 
 
-
-
-
 ##########################################################################
 ##########################################################################
 ##
@@ -175,7 +204,8 @@
       self.connection = pg.DB(dbname, host, -1, None, None, user, passwd)
       if GConfig.get('Encoding') != 'DEFAULT':
         self.connection.query("set encoding to '%s'" % GConfig.get('Encoding'))
-       
+
+      self.triggerExtensions = TriggerExtensions(self.connection)
     except pg.error, value:
       raise GDataObjects.ConnectionError, value
 



reply via email to

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