[Zope3-checkins] CVS: Zope3/src/zope/app/rdb - __init__.py:1.1.2.3

Fred L. Drake, Jr. fred@zope.com
Tue, 24 Dec 2002 10:45:31 -0500


Update of /cvs-repository/Zope3/src/zope/app/rdb
In directory cvs.zope.org:/tmp/cvs-serv30726

Modified Files:
      Tag: NameGeddon-branch
	__init__.py 
Log Message:
general cleanup, organization of imports


=== Zope3/src/zope/app/rdb/__init__.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/app/rdb/__init__.py:1.1.2.2	Tue Dec 24 10:22:35 2002
+++ Zope3/src/zope/app/rdb/__init__.py	Tue Dec 24 10:45:30 2002
@@ -12,9 +12,29 @@
 #
 ##############################################################################
 """
+Zope RDBMS Transaction Integration.
+
+Provides a proxy for interaction between the zope transaction
+framework and the db-api connection. Databases which want to support
+sub transactions need to implement their own proxy.
+
 $Id$
 """
-from zope.app.interfaces.rdb import IResultSet
+from types import StringTypes
+
+from persistence import Persistent
+
+from transaction import get_transaction
+from transaction.interfaces import IDataManager
+
+from zope.security import checker
+
+from zope.app.interfaces.rdb import DatabaseException
+from zope.app.interfaces.rdb import IResultSet, ISQLCommand
+from zope.app.interfaces.rdb import IZopeConnection, IZopeCursor
+from zope.app.interfaces.rdb import IZopeDatabaseAdapter
+
+from zope.app.component.nextservice import getNextService
 
 
 class ResultSet(list):
@@ -65,18 +85,6 @@
         return cmp(len(self), len(other))
 
 
-
-
-
-"""
-$Id$
-"""
-from zope.app.component.nextservice import getNextService
-
-from zope.app.interfaces.rdb import ISQLCommand
-
-
-
 class SQLCommand:
     """A simple version of a SQL Command."""
 
@@ -96,16 +104,6 @@
         return queryForResults(self.getConnection(), self.sql)
 
 
-"""The connection adapters contained by ConnectionService.
-
-$Id$
-"""
-from types import StringTypes
-from persistence import Persistent
-from zope.app.interfaces.rdb import IZopeDatabaseAdapter
-
-
-
 class DatabaseAdapterError(Exception):
     pass
 
@@ -231,12 +229,6 @@
     return result
 
 
-"""
-$Id$
-"""
-from types import UnicodeType
-from zope.app.interfaces.rdb import IZopeCursor
-
 class ZopeCursor:
     __implements__ = IZopeCursor
 
@@ -248,7 +240,7 @@
         """Executes an operation, registering the underlying
         connection with the transaction system.  """
 
-        if isinstance(operation, UnicodeType):
+        if isinstance(operation, unicode):
             operation = operation.encode('UTF-8')
         if parameters is None:
             parameters = {}
@@ -284,16 +276,6 @@
         return map(convertRow, results)
 
 
-"""
-$Id$
-"""
-from zope.app.interfaces.rdb import IZopeConnection
-from zope.app.interfaces.rdb import IZopeCursor
-
-
-from transaction import get_transaction
-
-
 class ZopeConnection:
 
     __implements__ =  IZopeConnection
@@ -334,13 +316,6 @@
         return self._type_info
 
 
-"""
-$Id$
-"""
-from zope.app.interfaces.rdb import DatabaseException
-
-
-
 def queryForResults(conn, query):
     """Convenience function to quickly execute a query."""
 
@@ -363,25 +338,6 @@
     return ResultSet(columns, results)
 
 
-
-
-
-
-
-
-
-
-
-""" Zope RDBMS Transaction Integration.
-
-Provides a proxy for interaction between the zope transaction
-framework and the db-api connection. Databases which want to support
-sub transactions need to implement their own proxy.
-
-$Id$
-"""
-from transaction.interfaces import IDataManager
-
 class ZopeDBTransactionManager:
 
     __implements__ =  IDataManager
@@ -405,11 +361,6 @@
         return None
 
 
-"""
-$Id$
-"""
-from zope.security import checker
-
 class Row(object):
     """Represents a row in a ResultSet"""
 
@@ -432,6 +383,7 @@
                 return c
         return 0
 
+
 def RowClassFactory(columns):
     """Creates a Row object"""
     klass_namespace = {}
@@ -440,4 +392,3 @@
     klass_namespace['__slots__'] = tuple(columns)
 
     return type('GeneratedRowClass', (Row,), klass_namespace)
-