commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r7575 - in trunk/gnue-common/src/datasources/drivers: Base DBSIG2


From: reinhard
Subject: [gnue] r7575 - in trunk/gnue-common/src/datasources/drivers: Base DBSIG2 appserver/appserver file
Date: Thu, 2 Jun 2005 11:57:29 -0500 (CDT)

Author: reinhard
Date: 2005-06-02 11:57:28 -0500 (Thu, 02 Jun 2005)
New Revision: 7575

Modified:
   trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/appserver/appserver/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/file/Base.py
Log:
Changed method names for virtual methods in ResultSet.


Modified: trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2005-06-02 
14:34:53 UTC (rev 7574)
+++ trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2005-06-02 
16:57:28 UTC (rev 7575)
@@ -153,16 +153,16 @@
     @param kwargs: Depends on the type.
     """
 
-    queryfunc = '_query_' + type
+    queryfunc = '_query_' + type + '_'
     if not hasattr (self, queryfunc):
       raise Exceptions.ObjectTypeNotAvailableError, type
 
     getattr (self, queryfunc) (self.__connection, **kwargs)
 
-    self.__generator = self._fetch (cache)
+    self.__generator = self._fetch_ (cache)
 
     # (TODO: could be delayed to first call of getRecordCount)
-    self.__recordCount = self._count ()
+    self.__recordCount = self._count_ ()
 
 
   # ---------------------------------------------------------------------------
@@ -675,7 +675,7 @@
     Close the database connection.
     """
 
-    self._close ()
+    self._close_ ()
 
 
   # ---------------------------------------------------------------------------
@@ -694,28 +694,28 @@
   # Virtual methods
   # ---------------------------------------------------------------------------
 
-  def _query_static (self, connection, data):
+  def _query_static_ (self, connection, data):
     """
     Execute a query.
 
-    Descendants would rather overwrite _query_object and/or _query_sql.
+    Descendants would rather overwrite _query_object_ and/or _query_sql_.
     Parameters depend on the type of query (object/sql).
     """
     self.__staticData = data
 
   # ---------------------------------------------------------------------------
 
-  def _count (self):
+  def _count_ (self):
     """
     Return the number of records returned by the query.
 
-    @return: Number of records that will be yielded by @L{_fetch}.
+    @return: Number of records that will be yielded by @L{_fetch_}.
     """
     return len (self.__staticData)
 
   # ---------------------------------------------------------------------------
 
-  def _fetch (self, cachesize):
+  def _fetch_ (self, cachesize):
     """
     Yield records from the query.
 
@@ -731,12 +731,12 @@
 
   # ---------------------------------------------------------------------------
 
-  def _close (self):
+  def _close_ (self):
     """
     Close the cursor.
 
     Descendants can overwrite this function to clean up things done in the
-    _query functions.
+    _query_ functions.
     """
     pass
 

Modified: trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py       
2005-06-02 14:34:53 UTC (rev 7574)
+++ trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py       
2005-06-02 16:57:28 UTC (rev 7575)
@@ -81,8 +81,8 @@
   # Execute query for object type datasources
   # ---------------------------------------------------------------------------
 
-  def _query_object (self, connection, table, fieldnames, condition, sortorder,
-                     distinct):
+  def _query_object_ (self, connection, table, fieldnames, condition,
+      sortorder, distinct):
 
     params = {}
     what = string.join (fieldnames, ', ')
@@ -114,7 +114,7 @@
   # Execute query for SQL type datasources
   # ---------------------------------------------------------------------------
 
-  def _query_sql (self, connection, sql):
+  def _query_sql_ (self, connection, sql):
 
     self.__cursor = connection.makecursor (sql)
 
@@ -133,7 +133,7 @@
   # Return result count
   # ---------------------------------------------------------------------------
 
-  def _count (self):
+  def _count_ (self):
 
     return self.__count
 
@@ -142,7 +142,7 @@
   # Yield data of next record
   # ---------------------------------------------------------------------------
 
-  def _fetch (self, cachesize):
+  def _fetch_ (self, cachesize):
 
     while True:
 
@@ -173,6 +173,6 @@
   # Close cursor
   # ---------------------------------------------------------------------------
 
-  def _close (self):
+  def _close_ (self):
 
     self.__cursor.close ()

Modified: 
trunk/gnue-common/src/datasources/drivers/appserver/appserver/ResultSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/appserver/appserver/ResultSet.py  
2005-06-02 14:34:53 UTC (rev 7574)
+++ trunk/gnue-common/src/datasources/drivers/appserver/appserver/ResultSet.py  
2005-06-02 16:57:28 UTC (rev 7575)
@@ -36,7 +36,7 @@
   # Implementation of virtual methods
   # ---------------------------------------------------------------------------
 
-  def _query_object (self, connection, table, fieldnames, condition, sortorder,
+  def _query_object_ (self, connection, table, fieldnames, condition, 
sortorder,
                      distinct):
     self.__sm = connection._sm
     self.__session_id = connection._sess_id
@@ -48,12 +48,12 @@
 
   # ---------------------------------------------------------------------------
 
-  def _count (self):
+  def _count_ (self):
     return self.__sm.count (self.__session_id, self.__list_id)
 
   # ---------------------------------------------------------------------------
 
-  def _fetch (self, cachesize):
+  def _fetch_ (self, cachesize):
     position = 0
     while True:
       rows = self.__sm.fetch (self.__session_id, self.__list_id, position,

Modified: trunk/gnue-common/src/datasources/drivers/file/Base.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/file/Base.py      2005-06-02 
14:34:53 UTC (rev 7574)
+++ trunk/gnue-common/src/datasources/drivers/file/Base.py      2005-06-02 
16:57:28 UTC (rev 7575)
@@ -86,7 +86,7 @@
   # Implementation of virtual methods
   # ---------------------------------------------------------------------------
 
-  def _query_object (self, connection, table, fieldnames, condition, sortorder,
+  def _query_object_ (self, connection, table, fieldnames, condition, 
sortorder,
                      distinct):
     self.__data = connection.getFile (table)
     self.__fieldnames = fieldnames
@@ -96,12 +96,12 @@
 
   # ---------------------------------------------------------------------------
 
-  def _count (self):
+  def _count_ (self):
     return len (self.__data)
 
   # ---------------------------------------------------------------------------
 
-  def _fetch (self, cachesize):
+  def _fetch_ (self, cachesize):
     for row in self.__data:
       result = {}
       for fn in self.__fieldnames:





reply via email to

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