[Zope-Checkins] CVS: Zope/lib/python/Products/ZGadflyDA - DA.py:1.16 __init__.py:1.16 db.py:1.14

Tres Seaver cvs-admin at zope.org
Tue Nov 18 08:17:42 EST 2003


Update of /cvs-repository/Zope/lib/python/Products/ZGadflyDA
In directory cvs.zope.org:/tmp/cvs-serv30559/lib/python/Products/ZGadflyDA

Modified Files:
	DA.py __init__.py db.py 
Log Message:
 - Merge tseaver-strexp_delenda-branch to the head.


=== Zope/lib/python/Products/ZGadflyDA/DA.py 1.15 => 1.16 ===
--- Zope/lib/python/Products/ZGadflyDA/DA.py:1.15	Wed Aug 14 18:25:17 2002
+++ Zope/lib/python/Products/ZGadflyDA/DA.py	Tue Nov 18 08:17:11 2003
@@ -19,6 +19,8 @@
 from db import DB, manage_DataSources
 import sys, DABase, Globals
 import Shared.DC.ZRDB.Connection, ThreadLock
+from zExceptions import BadRequest
+
 _Connection=Shared.DC.ZRDB.Connection.Connection
 
 _connections={}
@@ -84,7 +86,7 @@
                     self._v_database_connection=c[s]=DB(s)
                 except:
                     t, v, tb = sys.exc_info()
-                    raise 'BadRequest', (
+                    raise BadRequest, (
                         '<strong>Invalid connection string: </strong>'
                         '<CODE>%s</CODE><br>\n'
                         '<!--\n%s\n%s\n-->\n'


=== Zope/lib/python/Products/ZGadflyDA/__init__.py 1.15 => 1.16 ===
--- Zope/lib/python/Products/ZGadflyDA/__init__.py:1.15	Tue Feb 11 12:17:07 2003
+++ Zope/lib/python/Products/ZGadflyDA/__init__.py	Tue Nov 18 08:17:11 2003
@@ -20,6 +20,12 @@
 classes=('DA.Connection',)
 database_type='Gadfly'
 
+class GadflyError(Exception):
+    pass
+
+class QueryError(GadflyError):
+    pass
+
 misc_={'conn':
        Globals.ImageFile('Shared/DC/ZRDB/www/DBAdapterFolder_icon.gif')}
 


=== Zope/lib/python/Products/ZGadflyDA/db.py 1.13 => 1.14 ===
--- Zope/lib/python/Products/ZGadflyDA/db.py:1.13	Wed Aug 14 18:25:17 2002
+++ Zope/lib/python/Products/ZGadflyDA/db.py	Tue Nov 18 08:17:11 2003
@@ -22,6 +22,8 @@
 
 data_dir=os.path.join(Globals.data_dir,'gadfly')
 
+from Products.ZGadflyDA import GadflyError, QueryError
+
 def manage_DataSources():
 
     if not os.path.exists(data_dir):
@@ -29,14 +31,14 @@
             os.mkdir(data_dir)
             os.mkdir(os.path.join(data_dir,'demo'))
         except:
-            raise 'Gadfly Error', (
+            raise GadflyError, (
                 """
                 The Zope Gadfly Database Adapter requires the
                 existence of the directory, <code>%s</code>.  An error
                 occurred  while trying to create this directory.
                 """ % data_dir)
     if not os.path.isdir(data_dir):
-        raise 'Gadfly Error', (
+        raise GadflyError, (
             """
             The Zope Gadfly Database Adapter requires the
             existence of the directory, <code>%s</code>.  This
@@ -99,7 +101,7 @@
         self._register()
         c=self.db.cursor()
         queries=filter(None, map(strip,split(query_string, '\0')))
-        if not queries: raise 'Query Error', 'empty query'
+        if not queries: raise QueryError, 'empty query'
         desc=None
         result=[]
         for qs in queries:
@@ -108,7 +110,7 @@
             if d is None: continue
             if desc is None: desc=d
             elif d != desc:
-                raise 'Query Error', (
+                raise QueryError, (
                     'Multiple incompatible selects in '
                     'multiple sql-statement query'
                     )




More information about the Zope-Checkins mailing list