commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r7667 - in trunk/gnue-common/src/datasources: . drivers/Base driv


From: reinhard
Subject: [gnue] r7667 - in trunk/gnue-common/src/datasources: . drivers/Base drivers/DBSIG2 drivers/file drivers/other drivers/sql/interbase drivers/sql/maxdb drivers/sql/msado drivers/sql/mysql drivers/sql/oracle drivers/sql/postgres drivers/sql/sqlite
Date: Fri, 1 Jul 2005 03:04:54 -0500 (CDT)

Author: reinhard
Date: 2005-07-01 03:04:52 -0500 (Fri, 01 Jul 2005)
New Revision: 7667

Modified:
   trunk/gnue-common/src/datasources/ConnectionTriggerObj.py
   trunk/gnue-common/src/datasources/Exceptions.py
   trunk/gnue-common/src/datasources/GConditions.py
   trunk/gnue-common/src/datasources/GConnections.py
   trunk/gnue-common/src/datasources/GDataSource.py
   trunk/gnue-common/src/datasources/GSchema.py
   trunk/gnue-common/src/datasources/drivers/Base/Behavior.py
   trunk/gnue-common/src/datasources/drivers/Base/Connection.py
   trunk/gnue-common/src/datasources/drivers/DBSIG2/Behavior.py
   trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py
   trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/file/Base.py
   trunk/gnue-common/src/datasources/drivers/file/csvfile.py
   trunk/gnue-common/src/datasources/drivers/file/dbffile.py
   trunk/gnue-common/src/datasources/drivers/file/inifile.py
   trunk/gnue-common/src/datasources/drivers/other/appserver.py
   trunk/gnue-common/src/datasources/drivers/sql/interbase/Behavior.py
   trunk/gnue-common/src/datasources/drivers/sql/maxdb/Behavior.py
   trunk/gnue-common/src/datasources/drivers/sql/msado/Behavior.py
   trunk/gnue-common/src/datasources/drivers/sql/msado/adodbapi.py
   trunk/gnue-common/src/datasources/drivers/sql/mysql/Behavior.py
   trunk/gnue-common/src/datasources/drivers/sql/oracle/Base.py
   trunk/gnue-common/src/datasources/drivers/sql/oracle/Behavior.py
   trunk/gnue-common/src/datasources/drivers/sql/postgres/Behavior.py
   trunk/gnue-common/src/datasources/drivers/sql/sqlite/Behavior.py
   trunk/gnue-common/src/datasources/readgsd.py
Log:
Cleanup, docstrings, comments.


Modified: trunk/gnue-common/src/datasources/ConnectionTriggerObj.py
===================================================================
--- trunk/gnue-common/src/datasources/ConnectionTriggerObj.py   2005-06-28 
11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/ConnectionTriggerObj.py   2005-07-01 
08:04:52 UTC (rev 7667)
@@ -23,39 +23,62 @@
 
 __all__ = ['ConnectionTriggerObj']
 
-from gnue.common.definitions.GObjects import GObj
-from gnue.common.apps import GDebug
 import types
 
-_blockedMethods = ('connect','close','getLoginFields')
+from gnue.common.definitions import GObjects
+from gnue.common.apps import GDebug
 
-class ConnectionTriggerObj(GObj): 
+
+# =============================================================================
+# Connection wrapper object
+# =============================================================================
+
+class ConnectionTriggerObj(GObjects.GObj): 
   """
   Class that allows us to insert Connection objects into trigger namespaces
   """
+
+  _blockedMethods = ('connect','close','getLoginFields')
+
+
+  # ---------------------------------------------------------------------------
+  # Constructor
+  # ---------------------------------------------------------------------------
+
   def __init__(self, connection, name): 
     self.name = name
     self.__connection = connection
-    GObj.__init__(self, type="ConnTrigObj")
+    GObjects.GObj.__init__(self, type="ConnTrigObj")
     
     self._triggerGlobal = True
     self._triggerFunctions={}
                             
     for method in dir(connection): 
       function = getattr(connection,method)
-      if method[0] != '_' and method not in _blockedMethods and type(function) 
== types.MethodType:
+      if method[0] != '_' and method not in self._blockedMethods \
+          and type(function) == types.MethodType:
         self._triggerFunctions[method] = {'function':function}
     
-    self._triggerProperties={'login':  {'get':self.__getLogin}}
+    self._triggerProperties={'login': {'get':self.__getLogin}}
         
+
+  # ---------------------------------------------------------------------------
+  # Find out who connected
+  # ---------------------------------------------------------------------------
+
   def __getLogin(self): 
     return self.__connection.manager.getAuthenticatedUser(self.name)
-    
-    
+
+
+# =============================================================================
+# Add all connections to the namespace
+# =============================================================================
+
 def addAllConnections(connections, gobjNamespace): 
   """
   Adds all the connection names to the global trigger namespace
   """
+
   for name in connections.getConnectionNames(): 
     try: 
       conn = connections.getConnection(name)
@@ -63,4 +86,3 @@
       gDebug(1,"Cannot add connection %s to trigger namespace" % name)
       continue
     gobjNamespace.constructTriggerObject(ConnectionTriggerObj(conn, name))
-    

Modified: trunk/gnue-common/src/datasources/Exceptions.py
===================================================================
--- trunk/gnue-common/src/datasources/Exceptions.py     2005-06-28 11:27:42 UTC 
(rev 7666)
+++ trunk/gnue-common/src/datasources/Exceptions.py     2005-07-01 08:04:52 UTC 
(rev 7667)
@@ -23,6 +23,11 @@
 
 from gnue.common.apps import errors
 
+
+# =============================================================================
+# Exceptions
+# =============================================================================
+
 class Error(errors.gException):
   # Base exception
   pass

Modified: trunk/gnue-common/src/datasources/GConditions.py
===================================================================
--- trunk/gnue-common/src/datasources/GConditions.py    2005-06-28 11:27:42 UTC 
(rev 7666)
+++ trunk/gnue-common/src/datasources/GConditions.py    2005-07-01 08:04:52 UTC 
(rev 7667)
@@ -21,16 +21,15 @@
 #
 # $Id$
 
-from gnue.common.definitions.GObjects import GObj
-from gnue.common.formatting import GTypecast
-from gnue.common.apps import errors
-
-import mx.DateTime
-import string
-import sys
 import re
+import sys
+import mx.DateTime
 
+from gnue.common.apps import errors
+from gnue.common.definitions import GObjects
+from gnue.common.formatting import GTypecast
 
+
 # =============================================================================
 # Exceptions
 # =============================================================================
@@ -85,7 +84,7 @@
 # Base condition class; this is class is the root node of condition trees
 # =============================================================================
 
-class GCondition (GObj):
+class GCondition (GObjects.GObj):
   """
   A GCondition instance is allways the root node of a condition tree. All
   children of a GCondition node are evaluated and combined using an AND
@@ -110,7 +109,7 @@
         instance is the root element of the newly created condition tree.
     """
 
-    GObj.__init__ (self, parent, type = type)
+    GObjects.GObj.__init__ (self, parent, type = type)
     self._maxChildren = None
     self._operator    = u''
 
@@ -1063,7 +1062,7 @@
 
   def evaluate (self, lookup):
     self._needChildren ()
-    return string.upper (self._children [0].evaluate (lookup))
+    return (self._children [0].evaluate (lookup)).upper ()
 
 
 # -----------------------------------------------------------------------------
@@ -1082,7 +1081,7 @@
 
   def evaluate (self, lookup):
     self._needChildren ()
-    return string.lower (self._children [0].evaluate (lookup))
+    return (self._children [0].evaluate (lookup)).lower ()
 
 
 
@@ -1135,7 +1134,7 @@
 
     sql = '%s IN (SELECT %s FROM %s WHERE %s)' % (
         self.masterlink, self.detaillink, self.table,
-        string.join ([c.asSQL (paramDict) for c in self._children], ' AND '))
+        ' AND '.join ([c.asSQL (paramDict) for c in self._children]))
     return sql
 
 

Modified: trunk/gnue-common/src/datasources/GConnections.py
===================================================================
--- trunk/gnue-common/src/datasources/GConnections.py   2005-06-28 11:27:42 UTC 
(rev 7666)
+++ trunk/gnue-common/src/datasources/GConnections.py   2005-07-01 08:04:52 UTC 
(rev 7667)
@@ -20,25 +20,29 @@
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
 # $Id$
+
 """
 Class that loads connection definition files and maintains
 database connections.
+
+If you pass GConnections an "eventHandler" instance, it will generate a
+Connections:Connect(name, base) when a new connection is created.
 """
 
-# NOTES:
-#
-# If you pass GConnections an "eventHandler" instance, it will generate a
-# Connections:Connect(name, base) when a new connection is created.
-
 from ConfigParser import *
 from ConfigParser import RawConfigParser # is not in __all__
-import sys, string, copy, netrc
+
+import copy, netrc
+
 from gnue.common.apps import plugin, errors, i18n
-from gnue.common.datasources import Exceptions
-from gnue.common.datasources import GLoginHandler
 from gnue.common.utils.FileUtils import openResource, dyn_import
-import GLoginHandler
+from gnue.common.datasources import Exceptions, GLoginHandler
 
+
+# =============================================================================
+# Exceptions
+# =============================================================================
+
 class Error(errors.gException):
   # Base error
   pass
@@ -71,8 +75,16 @@
 LoginError = Exceptions.LoginError
 
 
+# =============================================================================
+# Connection manager class
+# =============================================================================
+
 class GConnections:
 
+  # ---------------------------------------------------------------------------
+  # Constructor
+  # ---------------------------------------------------------------------------
+
   def __init__(self, location, loginHandler=None, loginOptions={},
                eventhandler=None):
 
@@ -115,7 +127,7 @@
        self._primaries[section]={}
        for att in self._parser.options(section):
          if att == 'aliases':
-           for alias in 
string.split(string.lower(self._parser.get(section,att))):
+           for alias in ((self._parser.get(section,att)).lower ()).split ():
              self._aliases[alias] = section
          else:
            self._primaries[section][att] = self._parser.get(section, att)
@@ -131,6 +143,9 @@
     self._definitions.update(self._primaries)
 
 
+  # ---------------------------------------------------------------------------
+  # Set the login handler for opening connections
+  # ---------------------------------------------------------------------------
 
   def setLoginHandler(self, loginHandler):
     self._loginHandler = loginHandler
@@ -140,10 +155,18 @@
       print "WARNING: Login handler doesn't support 'default' login info."
 
 
+  # ---------------------------------------------------------------------------
+  # Check if a parameter is given for a connection
+  # ---------------------------------------------------------------------------
+
   def hasConnectionParameters(self, connection_name):
     return self._definitions.has_key(connection_name)
 
 
+  # ---------------------------------------------------------------------------
+  # Get a parameter for a connection
+  # ---------------------------------------------------------------------------
+
   def getConnectionParameter(self, connection_name, attribute, default=None):
     try:
       definition = self._definitions[connection_name]
@@ -159,10 +182,11 @@
       raise NotFoundError, tmsg
 
 
-  #
+  # ---------------------------------------------------------------------------
   # Returns an dictionary of dictionaries describing all connections:
   #  {connection name: {att name: value}}
-  #
+  # ---------------------------------------------------------------------------
+
   def getConnectionNames(self, includeAliases=True):
     if includeAliases:
       return self._definitions.keys()
@@ -170,10 +194,11 @@
       return self._primaries.keys()
 
 
-  #
+  # ---------------------------------------------------------------------------
   # Returns an dictionary of dictionaries describing all connections:
   #  {connection name: {att name: value}}
-  #
+  # ---------------------------------------------------------------------------
+
   def getAllConnectionParameters(self, includeAliases=1):
     if includeAliases:
       return copy.deepcopy(self._definitions)
@@ -181,10 +206,11 @@
       return copy.deepcopy(self._primaries)
 
 
-  #
+  # ---------------------------------------------------------------------------
   # Returns a dictionary describing a connection:
   #  {att name: value}
-  #
+  # ---------------------------------------------------------------------------
+
   def getConnectionParameters(self, connection_name):
     try:
       return copy.deepcopy(self._definitions[connection_name])
@@ -196,16 +222,16 @@
       raise NotFoundError, tmsg
 
 
-  #
+  # ---------------------------------------------------------------------------
   # Add a connection entry (session specific; i.e., doesn't add
   # to the connections.conf file, but to the current instance's
   # list of available connections.
-  #
+  # ---------------------------------------------------------------------------
+
   def addConnectionSpecification (self, name, parameters):
-    self._definitions[string.lower(name)] = copy.copy(parameters)
+    self._definitions [name.lower ()] = copy.copy (parameters)
 
 
-
   # ---------------------------------------------------------------------------
   # get a connection instance and optionally log into it
   # ---------------------------------------------------------------------------
@@ -250,12 +276,14 @@
 
     return conn
 
-  #
+
+  # ---------------------------------------------------------------------------
   # Has a connection been initialized/established?
-  #
+  # ---------------------------------------------------------------------------
+
   # TODO: this was likely broken
   def isConnectionActive(self, connection):
-    return self._openConnections.has_key(string.lower(connection))
+    return self._openConnections.has_key (connection.lower ())
 
 
   # ---------------------------------------------------------------------------
@@ -412,6 +440,9 @@
     connection.__connected = True
 
 
+  # ---------------------------------------------------------------------------
+  # Get the user name that has logged into a connection
+  # ---------------------------------------------------------------------------
 
   def getAuthenticatedUser(self, connection=None):
     try:
@@ -423,6 +454,10 @@
       return None
 
 
+  # ---------------------------------------------------------------------------
+  # Committ all connections
+  # ---------------------------------------------------------------------------
+
   def commitAll(self):
     """
     This function commits all transactions
@@ -431,6 +466,10 @@
       connection.commit()
 
 
+  # ---------------------------------------------------------------------------
+  # Rollback all connections
+  # ---------------------------------------------------------------------------
+
   def rollbackAll(self):
     """
     This function rolls back all transactions
@@ -439,6 +478,10 @@
       connection.rollback()
 
 
+  # ---------------------------------------------------------------------------
+  # Close all connections
+  # ---------------------------------------------------------------------------
+
   def closeAll(self):
     """
     This function closes all open connections.

Modified: trunk/gnue-common/src/datasources/GDataSource.py
===================================================================
--- trunk/gnue-common/src/datasources/GDataSource.py    2005-06-28 11:27:42 UTC 
(rev 7666)
+++ trunk/gnue-common/src/datasources/GDataSource.py    2005-07-01 08:04:52 UTC 
(rev 7667)
@@ -25,7 +25,6 @@
 """
 
 import cStringIO
-import string
 
 from gnue.common.apps import errors
 from gnue.common.definitions import GObjects, GParser, GParserHelpers
@@ -217,8 +216,8 @@
     # explicitfields attribute: reference them
     if hasattr (self, 'explicitfields'):
       if len (self.explicitfields):
-        for field in string.split(self.explicitfields,','):
-          self.referenceField(field.strip())
+        for field in self.explicitfields.split (','):
+          self.referenceField (field.strip ())
 
     # primarykey attribute: remember them and reference them
     if hasattr (self, 'primarykey'):
@@ -662,7 +661,7 @@
     if isinstance (order_by, basestring):
       gDebug (1, "DEPRECIATION WARNING: use of 'order_by' attribute is " \
                  "depreciated. Please use <sortorder> instead.")
-      for field in string.split (order_by, ','):
+      for field in order_by.split (','):
         (item, desc) = (field, field [-5:].lower () == ' desc')
         if desc:
           item = item [:-5].strip ()
@@ -806,7 +805,7 @@
     self._inits =[self.initialize]
 
   def _buildObject(self):
-    self.name = string.lower(self.name)
+    self.name = self.name.lower ()
     return GObjects.GObj._buildObject(self)
 
   def initialize(self):
@@ -1147,7 +1146,8 @@
   if len (parts) != 2:
     raise ResourceNotFoundError, (element, elementName)
 
-  (moduleName, className) = map (string.upper, parts)
+  moduleName = (parts [0]).upper ()
+  className  = (parts [1]).upper ()
   cond = ['and', ['eq', ['upper', ['field', 'gnue_name']],
                                   ['const', className]],
                  ['eq', ['upper', ['field', 'gnue_module.gnue_name']],

Modified: trunk/gnue-common/src/datasources/GSchema.py
===================================================================
--- trunk/gnue-common/src/datasources/GSchema.py        2005-06-28 11:27:42 UTC 
(rev 7666)
+++ trunk/gnue-common/src/datasources/GSchema.py        2005-07-01 08:04:52 UTC 
(rev 7667)
@@ -21,11 +21,8 @@
 #
 # $Id$
 
-from gnue.common.definitions.GObjects import GObj, GUndividedCollection
-from gnue.common.definitions.GRootObj import GRootObj
-from gnue.common.definitions.GParserHelpers import GLeafNode
+from gnue.common.definitions import GObjects, GParser, GParserHelpers, GRootObj
 from gnue.common.formatting import GTypecast
-from gnue.common.definitions import GParser
 
 
 xmlElements = None
@@ -34,7 +31,7 @@
 # The base class for GNUe Schema Definitions
 # =============================================================================
 
-class GSObject (GObj):
+class GSObject (GObjects.GObj):
 
   # ---------------------------------------------------------------------------
   # Constructor
@@ -42,7 +39,7 @@
 
   def __init__ (self, parent, objType, **kwargs):
 
-    GObj.__init__ (self, parent, objType)
+    GObjects.GObj.__init__ (self, parent, objType)
     self.buildObject (**kwargs)
 
 
@@ -50,11 +47,11 @@
 # This class implements the object tree for schema definitions
 # =============================================================================
 
-class GSSchema (GRootObj, GSObject):
+class GSSchema (GRootObj.GRootObj, GSObject):
 
   def __init__(self, parent = None):
 
-    GRootObj.__init__(self, 'schema', getXMLelements, __name__)
+    GRootObj.GRootObj.__init__(self, 'schema', getXMLelements, __name__)
     GSObject.__init__(self, parent, 'GSSchema')
 
 # =============================================================================
@@ -89,29 +86,31 @@
 
 # =============================================================================
 
-class GSField (GSObject, GLeafNode):
+class GSField (GSObject, GParserHelpers.GLeafNode):
   def __init__(self, parent, **params):
     GSObject.__init__(self, parent, 'GSField', **params)
 
 # =============================================================================
 
-class GSPrimaryKey (GUndividedCollection):
+class GSPrimaryKey (GObjects.GUndividedCollection):
   def __init__ (self, parent, **params):
-    GUndividedCollection.__init__(self, parent, 'GSPrimaryKey', **params)
+    GObjects.GUndividedCollection.__init__ (self, parent, 'GSPrimaryKey',
+        **params)
 
 
 # =============================================================================
 
-class GSPKField (GSObject, GLeafNode):
+class GSPKField (GSObject, GParserHelpers.GLeafNode):
   def __init__ (self, parent, **params):
     GSObject.__init__(self, parent, 'GSPKField', **params)
 
 
 # =============================================================================
 
-class GSConstraints (GUndividedCollection):
+class GSConstraints (GObjects.GUndividedCollection):
   def __init__ (self, parent, **params):
-    GUndividedCollection.__init__(self, parent, 'GSConstraints', **params)
+    GObjects.GUndividedCollection.__init__ (self, parent, 'GSConstraints',
+        **params)
 
 
 # =============================================================================
@@ -123,7 +122,7 @@
 
 # =============================================================================
 
-class GSFKField (GSObject, GLeafNode):
+class GSFKField (GSObject, GParserHelpers.GLeafNode):
   def __init__ (self, parent, **params):
     GSObject.__init__(self, parent, 'GSFKField', **params)
 
@@ -136,16 +135,17 @@
 
 # =============================================================================
 
-class GSUQField (GSObject, GLeafNode):
+class GSUQField (GSObject, GParserHelpers.GLeafNode):
   def __init__ (self, parent, **params):
     GSObject.__init__(self, parent, 'GSUQField', **params)
 
 
 # =============================================================================
 
-class GSIndexes (GUndividedCollection):
+class GSIndexes (GObjects.GUndividedCollection):
   def __init__ (self, parent, **params):
-    GUndividedCollection.__init__(self, parent, 'GSIndexes', **params)
+    GObjects.GUndividedCollection.__init__ (self, parent, 'GSIndexes',
+        **params)
 
 
 # =============================================================================
@@ -157,7 +157,7 @@
 
 # =============================================================================
 
-class GSIndexField (GSObject, GLeafNode):
+class GSIndexField (GSObject, GParserHelpers.GLeafNode):
   def __init__ (self, parent, **params):
     GSObject.__init__(self, parent, 'GSIndexField', **params)
 
@@ -208,14 +208,14 @@
 
 # =============================================================================
 
-class GSValue (GSObject, GLeafNode):
+class GSValue (GSObject, GParserHelpers.GLeafNode):
   def __init__ (self, parent, **params):
     GSObject.__init__ (self, parent, 'GSValue', **params)
 
 
 # =============================================================================
 
-class GSDescription (GSObject, GLeafNode):
+class GSDescription (GSObject, GParserHelpers.GLeafNode):
   def __init__ (self, parent, **params):
     GSObject.__init__ (self, parent, 'GSDescription', **params)
 

Modified: trunk/gnue-common/src/datasources/drivers/Base/Behavior.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/Behavior.py  2005-06-28 
11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/Base/Behavior.py  2005-07-01 
08:04:52 UTC (rev 7667)
@@ -24,6 +24,7 @@
 from gnue.common.apps import errors
 from gnue.common.datasources import GSchema
 
+
 # =============================================================================
 # Exceptions
 # =============================================================================

Modified: trunk/gnue-common/src/datasources/drivers/Base/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/Connection.py        
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/Base/Connection.py        
2005-07-01 08:04:52 UTC (rev 7667)
@@ -21,8 +21,6 @@
 #
 # $Id$
 
-import copy
-
 from gnue.common.apps import GDebug
 
 

Modified: trunk/gnue-common/src/datasources/drivers/DBSIG2/Behavior.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/DBSIG2/Behavior.py        
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/DBSIG2/Behavior.py        
2005-07-01 08:04:52 UTC (rev 7667)
@@ -21,8 +21,8 @@
 #
 # $Id$
 
+from gnue.common.datasources import GSchema
 from gnue.common.datasources.drivers import Base
-from gnue.common.datasources import GSchema
 
 
 # =============================================================================

Modified: trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py      
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py      
2005-07-01 08:04:52 UTC (rev 7667)
@@ -23,7 +23,6 @@
 
 __all__ = ['Connection']
 
-import string
 import sys
 import mx.DateTime
 
@@ -142,10 +141,10 @@
     s = statement
     l = []
     while True:
-      start = string.find (s, '%(')
+      start = s.find ('%(')
       if start == -1:
         break
-      end = string.find (s, ')s', start)
+      end = s.find (')s', start)
       if end == -1:
         break
       key = s [start+2:end]
@@ -160,10 +159,10 @@
     l = []
     i = 0
     while True:
-      start = string.find (s, '%(')
+      start = s.find ('%(')
       if start == -1:
         break
-      end = string.find (s, ')s', start)
+      end = s.find (')s', start)
       if end == -1:
         break
       i += 1
@@ -178,10 +177,10 @@
     s = statement
     values = []
     while True:
-      start = string.find (s, '%(')
+      start = s.find ('%(')
       if start == -1:
         break
-      end = string.find (s, ')s', start)
+      end = s.find (')s', start)
       if end == -1:
         break
       key = s [start+2:end]
@@ -196,10 +195,10 @@
     s = statement
     l = []
     while True:
-      start = string.find (s, '%(')
+      start = s.find ('%(')
       if start == -1:
         break
-      end = string.find (s, ')s', start)
+      end = s.find (')s', start)
       if end == -1:
         break
       key = s [start+2:end]
@@ -365,7 +364,7 @@
         where.append ("%s=%%(%s)s" % (field, key))
         parameters [key] = value
 
-    return (string.join (where, ' AND '), parameters)
+    return (' AND '.join (where), parameters)
 
 
   # ---------------------------------------------------------------------------
@@ -429,9 +428,8 @@
       fields.append (field)
       values.append ('%%(%s)s' % key)
       parameters [key] = value
-    statement = "INSERT INTO %s (%s) VALUES (%s)" % (table,
-                                                     string.join (fields,', '),
-                                                     string.join (values,', '))
+    statement = "INSERT INTO %s (%s) VALUES (%s)" % (table, ', '.join (fields),
+        ', '.join (values))
     return self.__execute (statement, parameters, recno)
 
   # ---------------------------------------------------------------------------
@@ -443,9 +441,8 @@
       key = 'new_' + field
       updates.append ("%s=%%(%s)s" % (field, key))
       parameters [key] = value
-    statement = "UPDATE %s SET %s WHERE %s" % (table,
-                                               string.join (updates, ', '),
-                                               where)
+    statement = "UPDATE %s SET %s WHERE %s" % (table, ', '.join (updates),
+        where)
     self.__execute (statement, parameters, recno)
 
   # ---------------------------------------------------------------------------
@@ -459,8 +456,8 @@
 
   def _requery_ (self, table, oldfields, fields):
     (where, parameters) = self.__where (oldfields)
-    statement = "SELECT %s FROM %s WHERE %s" % (string.join (fields, ', '),
-                                                table, where)
+    statement = "SELECT %s FROM %s WHERE %s" % (', '.join (fields), table,
+        where)
     try:
       rows = self.sql (statement, parameters)
     except self._driver.DatabaseError:

Modified: trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py       
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py       
2005-07-01 08:04:52 UTC (rev 7667)
@@ -23,8 +23,6 @@
 
 __all__ = ['ResultSet']
 
-import string
-
 from gnue.common.datasources.drivers import Base
 
 
@@ -59,7 +57,7 @@
         fmt = ignorecase and "UPPER (%s)%s" or "%s%s"
         order.append (fmt % (field, descending and ' DESC' or ''))
 
-      query += ' ORDER BY ' + string.join (order, ', ')
+      query += ' ORDER BY ' + ', '.join (order)
 
     return query
 
@@ -86,7 +84,7 @@
       sortorder, distinct):
 
     params = {}
-    what = string.join (fieldnames, ', ')
+    what = ', '.join (fieldnames)
     if distinct:
       what = 'DISTINCT ' + what
     where = condition.asSQL (params)

Modified: trunk/gnue-common/src/datasources/drivers/file/Base.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/file/Base.py      2005-06-28 
11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/file/Base.py      2005-07-01 
08:04:52 UTC (rev 7667)
@@ -31,8 +31,8 @@
 import os
 
 from gnue import paths
+from gnue.common.datasources import GSchema
 from gnue.common.datasources.drivers import Base
-from gnue.common.datasources import GSchema
 
 
 # =============================================================================

Modified: trunk/gnue-common/src/datasources/drivers/file/csvfile.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/file/csvfile.py   2005-06-28 
11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/file/csvfile.py   2005-07-01 
08:04:52 UTC (rev 7667)
@@ -27,8 +27,8 @@
 
 import csv
 
+from gnue.common.datasources import GSchema
 from gnue.common.datasources.drivers.file import Base
-from gnue.common.datasources import GSchema
 
 
 # =============================================================================

Modified: trunk/gnue-common/src/datasources/drivers/file/dbffile.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/file/dbffile.py   2005-06-28 
11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/file/dbffile.py   2005-07-01 
08:04:52 UTC (rev 7667)
@@ -25,9 +25,9 @@
 Database driver plugin for DBF file backends.
 """
 
+from gnue.common.utils import dbf
+from gnue.common.datasources import GSchema
 from gnue.common.datasources.drivers.file import Base
-from gnue.common.datasources import GSchema
-from gnue.common.utils import dbf
 
 
 # =============================================================================

Modified: trunk/gnue-common/src/datasources/drivers/file/inifile.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/file/inifile.py   2005-06-28 
11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/file/inifile.py   2005-07-01 
08:04:52 UTC (rev 7667)
@@ -28,8 +28,8 @@
 import ConfigParser
 
 from gnue.common.apps import errors
+from gnue.common.datasources import GSchema
 from gnue.common.datasources.drivers.file import Base
-from gnue.common.datasources import GSchema
 
 
 # =============================================================================

Modified: trunk/gnue-common/src/datasources/drivers/other/appserver.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/other/appserver.py        
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/other/appserver.py        
2005-07-01 08:04:52 UTC (rev 7667)
@@ -28,9 +28,9 @@
 import sys
 
 from gnue.common.apps import errors, i18n
+from gnue.common.rpc import client
 from gnue.common.datasources import Exceptions, GSchema
 from gnue.common.datasources.drivers import Base
-from gnue.common.rpc import client
 
 
 # =============================================================================

Modified: trunk/gnue-common/src/datasources/drivers/sql/interbase/Behavior.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/interbase/Behavior.py 
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/sql/interbase/Behavior.py 
2005-07-01 08:04:52 UTC (rev 7667)
@@ -27,9 +27,8 @@
 
 import re
 
-from gnue.common.datasources.GLoginHandler import BasicLoginHandler
+from gnue.common.datasources import GLoginHandler, GSchema
 from gnue.common.datasources.drivers import DBSIG2
-from gnue.common.datasources import GSchema
 
 
 # =============================================================================
@@ -87,7 +86,7 @@
     host     = self.__connection.parameters.get ('host', None)
     gsecbin  = self.__connection.parameters.get ('gsecbin', 'gsec')
 
-    loginHandler = BasicLoginHandler ()
+    loginHandler = GLoginHandler.BasicLoginHandler ()
     fields       = [(u_("Password"), '_password', 'password', None, None, [])]
     title        = u_("Logon for SYSDBA into Security Database")
 

Modified: trunk/gnue-common/src/datasources/drivers/sql/maxdb/Behavior.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/maxdb/Behavior.py     
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/sql/maxdb/Behavior.py     
2005-07-01 08:04:52 UTC (rev 7667)
@@ -26,9 +26,8 @@
 """
 
 from gnue.common.apps import errors
-from gnue.common.datasources.GLoginHandler import BasicLoginHandler
+from gnue.common.datasources import GLoginHandler, GSchema
 from gnue.common.datasources.drivers import DBSIG2
-from gnue.common.datasources import GSchema
 
 
 # =============================================================================
@@ -91,7 +90,7 @@
     title  = u_("OS User for host %s") % host
     fields = [(u_("User Name"), '_username', 'string', None, None, []),
               (u_("Password"), '_password', 'password', None, None, [])]
-    res    = BasicLoginHandler ().askLogin (title, fields, {})
+    res    = GLoginHandler.BasicLoginHandler ().askLogin (title, fields, {})
 
     try:
       session = sapdb.dbm.DBM (host, '', '',

Modified: trunk/gnue-common/src/datasources/drivers/sql/msado/Behavior.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/msado/Behavior.py     
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/sql/msado/Behavior.py     
2005-07-01 08:04:52 UTC (rev 7667)
@@ -25,8 +25,8 @@
 Schema support plugin for MS-ADO backends.
 """
 
+from gnue.common.datasources import GSchema
 from gnue.common.datasources.drivers import Base
-from gnue.common.datasources import GSchema
 
 
 # =============================================================================

Modified: trunk/gnue-common/src/datasources/drivers/sql/msado/adodbapi.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/msado/adodbapi.py     
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/sql/msado/adodbapi.py     
2005-07-01 08:04:52 UTC (rev 7667)
@@ -27,8 +27,6 @@
 
 __all__ = ['Connection']
 
-import string
-
 from gnue.common.datasources.drivers import DBSIG2
 from gnue.common.datasources.drivers.sql.msado import Behavior
 
@@ -158,6 +156,6 @@
         params [oledbName] = connectData [gnueName]
 
     p = ["%s=%s" % (k, v) for (k, v) in params.items ()]
-    connectstring = string.join (p, ';')
+    connectstring = ';'.join (p)
 
     return ([connectstring], {})

Modified: trunk/gnue-common/src/datasources/drivers/sql/mysql/Behavior.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/mysql/Behavior.py     
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/sql/mysql/Behavior.py     
2005-07-01 08:04:52 UTC (rev 7667)
@@ -27,8 +27,8 @@
 
 import os
 
+from gnue.common.datasources import GSchema
 from gnue.common.datasources.drivers import DBSIG2
-from gnue.common.datasources import GSchema
 
 
 # =============================================================================

Modified: trunk/gnue-common/src/datasources/drivers/sql/oracle/Base.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/oracle/Base.py        
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/sql/oracle/Base.py        
2005-07-01 08:04:52 UTC (rev 7667)
@@ -30,6 +30,7 @@
 __noplugin__ = True
 
 import os
+
 from gnue.common.datasources.drivers import DBSIG2
 from gnue.common.datasources.drivers.sql.oracle import Behavior
 

Modified: trunk/gnue-common/src/datasources/drivers/sql/oracle/Behavior.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/oracle/Behavior.py    
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/sql/oracle/Behavior.py    
2005-07-01 08:04:52 UTC (rev 7667)
@@ -25,8 +25,8 @@
 Schema support plugin for Oracle backends.
 """
 
+from gnue.common.datasources import GSchema
 from gnue.common.datasources.drivers import DBSIG2
-from gnue.common.datasources import GSchema
 
 
 # =============================================================================

Modified: trunk/gnue-common/src/datasources/drivers/sql/postgres/Behavior.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/postgres/Behavior.py  
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/sql/postgres/Behavior.py  
2005-07-01 08:04:52 UTC (rev 7667)
@@ -28,8 +28,8 @@
 import os
 
 from gnue.common.apps import errors
+from gnue.common.datasources import GSchema
 from gnue.common.datasources.drivers import DBSIG2
-from gnue.common.datasources import GSchema
 
 
 # =============================================================================

Modified: trunk/gnue-common/src/datasources/drivers/sql/sqlite/Behavior.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/sqlite/Behavior.py    
2005-06-28 11:27:42 UTC (rev 7666)
+++ trunk/gnue-common/src/datasources/drivers/sql/sqlite/Behavior.py    
2005-07-01 08:04:52 UTC (rev 7667)
@@ -28,8 +28,8 @@
 import re
 
 from gnue.common.apps import errors
+from gnue.common.datasources import GSchema
 from gnue.common.datasources.drivers import DBSIG2
-from gnue.common.datasources import GSchema
 
 
 # ===========================================================================

Modified: trunk/gnue-common/src/datasources/readgsd.py
===================================================================
--- trunk/gnue-common/src/datasources/readgsd.py        2005-06-28 11:27:42 UTC 
(rev 7666)
+++ trunk/gnue-common/src/datasources/readgsd.py        2005-07-01 08:04:52 UTC 
(rev 7667)
@@ -26,12 +26,12 @@
 import sets
 import mx.DateTime.ISO
 
-from gnue.common.apps import errors
-from gnue.common.apps.GClientApp import *
+from gnue.common.apps import errors, GClientApp
 from gnue.common.datasources import GSchema, GDataSource
 from gnue.common.utils.FileUtils import openResource
 from gnue.common.apps.i18n import translate as _            # for epydoc
 
+
 # =============================================================================
 # Exceptions
 # =============================================================================
@@ -110,12 +110,12 @@
 # Client application reading and importing GNUe Schema Definition files
 # =============================================================================
 
-class gsdClient (GClientApp):
+class gsdClient (GClientApp.GClientApp):
 
   NAME    = "readgsd"
   COMMAND = "readgsd"
   VERSION = "0.1.0"
-  USAGE   = "%s file [, file, ...]" % GClientApp.USAGE
+  USAGE   = "%s file [, file, ...]" % GClientApp.GClientApp.USAGE
   SUMMARY = _("Import GNUe Schema Definition files into a given connection")
 
 
@@ -161,7 +161,7 @@
                  "which means all questions are answered with 'yes' "
                  "automatically."))
 
-    GClientApp.__init__ (self, connections, 'schema', {})
+    GClientApp.GClientApp.__init__ (self, connections, 'schema', {})
 
 
   # ---------------------------------------------------------------------------





reply via email to

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