[Checkins] SVN: zope.rdb/trunk/ - Remove body of DatabaseException, base Exception class already

Sidnei da Silva sidnei at enfoldsystems.com
Wed Oct 8 00:29:34 EDT 2008


Log message for revision 91892:
  - Remove body of DatabaseException, base Exception class already
    provides the same functionality.
  
  - Use hashlib.md5 instead of md5.new if available. md5 module is
    deprecated and will be removed in a future Python release.
  
  - Remove usage of 'as' as variable name. 'as' is a keyword in Python
    2.6 and generates a SyntaxError.
  
  

Changed:
  U   zope.rdb/trunk/CHANGES.txt
  U   zope.rdb/trunk/src/zope/rdb/gadfly/gfdb0.py
  U   zope.rdb/trunk/src/zope/rdb/gadfly/sqlbind.py
  U   zope.rdb/trunk/src/zope/rdb/interfaces.py

-=-
Modified: zope.rdb/trunk/CHANGES.txt
===================================================================
--- zope.rdb/trunk/CHANGES.txt	2008-10-08 03:53:21 UTC (rev 91891)
+++ zope.rdb/trunk/CHANGES.txt	2008-10-08 04:29:33 UTC (rev 91892)
@@ -1,7 +1,19 @@
 Change History
 ==============
 
+3.4.1 (Unreleased)
+------------------
+
+- Remove body of DatabaseException, base Exception class already
+  provides the same functionality.
+
+- Use hashlib.md5 instead of md5.new if available. md5 module is
+  deprecated and will be removed in a future Python release.
+
+- Remove usage of 'as' as variable name. 'as' is a keyword in Python
+  2.6 and generates a SyntaxError.
+
 3.4.0 (2007/09/01)
 ------------------
 
-Initial release as an independent package
+- Initial release as an independent package

Modified: zope.rdb/trunk/src/zope/rdb/gadfly/gfdb0.py
===================================================================
--- zope.rdb/trunk/src/zope/rdb/gadfly/gfdb0.py	2008-10-08 03:53:21 UTC (rev 91891)
+++ zope.rdb/trunk/src/zope/rdb/gadfly/gfdb0.py	2008-10-08 04:29:33 UTC (rev 91892)
@@ -4,6 +4,12 @@
 
 import os
 
+try:
+    from hashlib import md5
+except ImportError:
+    # Python 2.4 and earlier
+    from md5 import md5
+
 # use whatever kjbuckets sqlsem is using
 #from sqlsem import kjbuckets, maketuple
 
@@ -12,8 +18,7 @@
 
 # use md5 checksum (stub if md5 unavailable?)
 def checksum(string):
-    from md5 import new
-    return new(string).digest()
+    return md5(string).digest()
 
 def recursive_dump(data, prefix="["):
     """for debugging"""

Modified: zope.rdb/trunk/src/zope/rdb/gadfly/sqlbind.py
===================================================================
--- zope.rdb/trunk/src/zope/rdb/gadfly/sqlbind.py	2008-10-08 03:53:21 UTC (rev 91891)
+++ zope.rdb/trunk/src/zope/rdb/gadfly/sqlbind.py	2008-10-08 04:29:33 UTC (rev 91892)
@@ -54,7 +54,7 @@
 
 # create view statement stuff
 def createview(l, c):
-    [create, view, name, namelist, as, selection] = l
+    [create, view, name, namelist, as_, selection] = l
     from sqlsem import CreateView
     return CreateView(name, namelist, selection)
 
@@ -306,11 +306,11 @@
     return others
 
 def trl1as(l,c):
-    [name, as, alias] = l
+    [name, as_, alias] = l
     return [(name, alias)]
 
 def trlnas(l,c):
-    [name, as, alias, comma, others] = l
+    [name, as_, alias, comma, others] = l
     others.insert(0, (name, alias))
     return others
 
@@ -584,7 +584,7 @@
     return (exp, None) # no binding!
 
 def selectname(list, context):
-    [exp, as, alias] = list
+    [exp, as_, alias] = list
     return (exp, alias)
 
 colalias = elt0

Modified: zope.rdb/trunk/src/zope/rdb/interfaces.py
===================================================================
--- zope.rdb/trunk/src/zope/rdb/interfaces.py	2008-10-08 03:53:21 UTC (rev 91891)
+++ zope.rdb/trunk/src/zope/rdb/interfaces.py	2008-10-08 04:29:33 UTC (rev 91892)
@@ -89,12 +89,6 @@
 class DatabaseException(Exception):
     """Generic Database Error"""
 
-    def __init__(self, message):
-        self.message = message
-
-    def __str__(self):
-        return self.message
-
 class DatabaseAdapterError(DatabaseException):
     pass
 



More information about the Checkins mailing list