[Zope-Checkins] CVS: Zope/lib/python/Shared/DC/ZRDB - Aqueduct.py:1.57 Connection.py:1.38 DA.py:1.112 Search.py:1.21 dbi_db.py:1.11 sqlgroup.py:1.10 sqltest.py:1.19 sqlvar.py:1.15

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


Update of /cvs-repository/Zope/lib/python/Shared/DC/ZRDB
In directory cvs.zope.org:/tmp/cvs-serv30559/lib/python/Shared/DC/ZRDB

Modified Files:
	Aqueduct.py Connection.py DA.py Search.py dbi_db.py 
	sqlgroup.py sqltest.py sqlvar.py 
Log Message:
 - Merge tseaver-strexp_delenda-branch to the head.


=== Zope/lib/python/Shared/DC/ZRDB/Aqueduct.py 1.56 => 1.57 ===
--- Zope/lib/python/Shared/DC/ZRDB/Aqueduct.py:1.56	Wed Aug 14 17:50:59 2002
+++ Zope/lib/python/Shared/DC/ZRDB/Aqueduct.py	Tue Nov 18 08:17:14 2003
@@ -24,6 +24,7 @@
 from OFS import SimpleItem
 from AccessControl.Role import RoleManager
 from DocumentTemplate import HTML
+from zExceptions import Redirect
 
 from string import strip, replace
 
@@ -121,7 +122,7 @@
 
     def index_html(self, URL1):
         " "
-        raise 'Redirect', ("%s/manage_testForm" % URL1)
+        raise Redirect, ("%s/manage_testForm" % URL1)
 
 class Composite:
 


=== Zope/lib/python/Shared/DC/ZRDB/Connection.py 1.37 => 1.38 ===
--- Zope/lib/python/Shared/DC/ZRDB/Connection.py:1.37	Wed Oct 22 16:33:56 2003
+++ Zope/lib/python/Shared/DC/ZRDB/Connection.py	Tue Nov 18 08:17:14 2003
@@ -26,6 +26,7 @@
 from sys import exc_info
 from zLOG import LOG, ERROR
 import DocumentTemplate, RDB
+from zExceptions import BadRequest
 
 class Connection(
     Globals.Persistent,
@@ -168,7 +169,7 @@
             if s:
                 self.connect(s)
                 return self._v_database_connection
-            raise 'Database Not Connected',(
+            raise BadRequest,(
                 '''The database connection is not connected''')
 
     def connect(self,s):
@@ -179,7 +180,7 @@
                 self._v_database_connection=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'
                     % (s,t,v)), tb


=== Zope/lib/python/Shared/DC/ZRDB/DA.py 1.111 => 1.112 ===
--- Zope/lib/python/Shared/DC/ZRDB/DA.py:1.111	Sun Jul  6 06:44:20 2003
+++ Zope/lib/python/Shared/DC/ZRDB/DA.py	Tue Nov 18 08:17:14 2003
@@ -37,6 +37,7 @@
 from AccessControl.DTML import RestrictedDTML
 from webdav.Resource import Resource
 from webdav.Lockable import ResourceLockedError
+from zExceptions import BadRequest
 try: from IOBTree import Bucket
 except: Bucket=lambda:{}
 
@@ -411,7 +412,7 @@
                 c))
 
         try: DB__=dbc()
-        except: raise 'Database Error', (
+        except: raise BadRequest, (
             '%s is not connected to a database' % self.id)
 
         if hasattr(self, 'aq_parent'):


=== Zope/lib/python/Shared/DC/ZRDB/Search.py 1.20 => 1.21 ===
--- Zope/lib/python/Shared/DC/ZRDB/Search.py:1.20	Wed Aug 14 17:50:59 2002
+++ Zope/lib/python/Shared/DC/ZRDB/Search.py	Tue Nov 18 08:17:14 2003
@@ -50,7 +50,7 @@
                 arguments[key]=arg
                 keys.append(key)
         if q._searchable_result_columns() is None:
-            raise 'Unusable Searchable Error',(
+            raise ValueError,(
                 """The input searchable object, <em>%s</em>,
                 has not been tested.  Until it has been tested,
                 it\'s output schema is unknown, and a report


=== Zope/lib/python/Shared/DC/ZRDB/dbi_db.py 1.10 => 1.11 ===
--- Zope/lib/python/Shared/DC/ZRDB/dbi_db.py:1.10	Wed Aug 14 17:50:59 2002
+++ Zope/lib/python/Shared/DC/ZRDB/dbi_db.py	Tue Nov 18 08:17:14 2003
@@ -34,6 +34,9 @@
     ('Calls',  'STRING', 12, 12, 0, 0, 1),
     ]
 
+class QueryError(Exception):
+    pass
+
 class DB:
 
     _p_oid=_p_changed=_registered=None
@@ -42,7 +45,7 @@
 
     def Database_Connection(self, string):
         # Create a dbi-compatible database connection
-        raise 'ImplementedBySubclass', (
+        raise NotImplemetedError, (
             'attempt to create a database connection for an abstract dbi')
 
     Database_Error='Should be overriden by subclass'
@@ -79,12 +82,12 @@
             c=self.cursor
             self.register()
             queries=filter(None, map(strip,split(query_string, '\0')))
-            if not queries: raise 'Query Error', 'empty query'
+            if not queries: raise QueryError, 'empty query'
             if len(queries) > 1:
                 result=[]
                 for qs in queries:
                     r=c.execute(qs)
-                    if r is None: raise 'Query Error', (
+                    if r is None: raise QueryError, (
                         'select in multiple sql-statement query'
                         )
                     result.append((qs, str(`r`), calls))


=== Zope/lib/python/Shared/DC/ZRDB/sqlgroup.py 1.9 => 1.10 ===
--- Zope/lib/python/Shared/DC/ZRDB/sqlgroup.py:1.9	Wed Aug 14 17:50:59 2002
+++ Zope/lib/python/Shared/DC/ZRDB/sqlgroup.py	Tue Nov 18 08:17:14 2003
@@ -110,7 +110,7 @@
             return r
 
         if self.required:
-            raise 'Input Error', 'Not enough input was provided!<p>'
+            raise ValueError, 'Not enough input was provided!<p>'
 
         return ''
 


=== Zope/lib/python/Shared/DC/ZRDB/sqltest.py 1.18 => 1.19 ===
--- Zope/lib/python/Shared/DC/ZRDB/sqltest.py:1.18	Wed Aug 14 17:50:59 2002
+++ Zope/lib/python/Shared/DC/ZRDB/sqltest.py	Tue Nov 18 08:17:14 2003
@@ -129,11 +129,11 @@
         except KeyError:
             if args.has_key('optional') and args['optional']:
                 return ''
-            raise 'Missing Input', 'Missing input variable, <em>%s</em>' % name
+            raise ValueError, 'Missing input variable, <em>%s</em>' % name
 
         if type(v) in (ListType, TupleType):
             if len(v) > 1 and not self.multiple:
-                raise 'Multiple Values', (
+                raise ValueError, (
                     'multiple values are not allowed for <em>%s</em>'
                     % name)
         else: v=[v]
@@ -175,7 +175,7 @@
 
         if not vs:
             if self.optional: return ''
-            raise 'Missing Input', (
+            raise ValueError, (
                 'No input was provided for <em>%s</em>' % name)
 
         if len(vs) > 1:


=== Zope/lib/python/Shared/DC/ZRDB/sqlvar.py 1.14 => 1.15 ===
--- Zope/lib/python/Shared/DC/ZRDB/sqlvar.py:1.14	Wed Mar 19 15:21:23 2003
+++ Zope/lib/python/Shared/DC/ZRDB/sqlvar.py	Tue Nov 18 08:17:14 2003
@@ -96,7 +96,7 @@
                 return 'null'
             if type(expr) is not type(''):
                 raise
-            raise 'Missing Input', 'Missing input variable, <em>%s</em>' % name
+            raise ValueError, 'Missing input variable, <em>%s</em>' % name
 
         if t=='int':
             try:




More information about the Zope-Checkins mailing list