[Zope-Checkins] CVS: Zope/lib/python/Shared/DC/ZRDB - Aqueduct.py:1.49.8.1 RDB.py:1.30.20.1

Shane Hathaway shane@digicool.com
Thu, 9 Aug 2001 13:34:13 -0400


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

Modified Files:
      Tag: NR-branch
	Aqueduct.py RDB.py 
Log Message:
Sync NR-branch with trunk.  Sorry about so many checkin messages...


=== Zope/lib/python/Shared/DC/ZRDB/Aqueduct.py 1.49 => 1.49.8.1 ===
     def __len__(self): return len(self._data)
 
+
 def parse(text,
           result=None,
           keys=None,
@@ -351,35 +352,40 @@
               r'([\000- ]*([^\000- ="]+)="([^"]*)")'),
           ):
 
+
     if result is None:
-        result = {}
-        keys=[]
+        result  = {}
+        keys    = []
 
     __traceback_info__=text
 
     mo  = parmre.match(text)
+
     if mo:
-        name=mo.group(2)
-        value={'default':mo.group(3)}
-        l=len(mo.group(1))
+        name    = mo.group(2)
+        value   = {'default':mo.group(3)}
+        l       = len(mo.group(1))
+
     else:
         mo = qparmre.match(text)
+
         if mo:
-                name=mo.group(1)
-                value={'default':mo.group(3)}
-                l=len(mo.group(2))
+            name    = mo.group(2)
+            value   = {'default':mo.group(3)}
+            l       = len(mo.group(1))
+
         else:
             mo = unparmre.match(text)
+
             if mo:
-                name=mo.group(2)
-                l=len(mo.group(1))
-                value={}
+                name    = mo.group(2)
+                value   = {}
+                l       = len(mo.group(1))
             else:
-                if not text or not strip(text): return Args(result,keys)
+                if not text or not text.strip(): return Args(result,keys)
                 raise InvalidParameter, text
 
-
-    lt=string.find(name,':')
+    lt=name.find(':')
     if lt > 0:
         value['type']=name[lt+1:]
         name=name[:lt]
@@ -388,6 +394,7 @@
     keys.append(name)
 
     return parse(text[l:],result,keys)
+
 
 def quotedHTML(text,
                character_entities=(


=== Zope/lib/python/Shared/DC/ZRDB/RDB.py 1.30 => 1.30.20.1 ===
 
 from string import split, strip, lower, upper, atof, atoi, atol, find, join,find
-import DateTime
+import DateTime,re
 from Missing import MV
 from array import array
 from Record import Record
@@ -180,12 +180,14 @@
             _def=strip(_def)
             if not _def:
                 raise ValueError, ('Empty column definition for %s' % names[i])
-            if defre.match(_def) is None:
+
+            mo = defre.match(_def)
+            if mo is None:
                 raise ValueError, (
                     'Invalid column definition for, %s, for %s'
                     % _def, names[i])
-            type=lower(defre.group(2))
-            width=defre.group(1)
+            type  = mo.group(2).lower()
+            width = mo.group(1)
             if width: width=atoi(width)
             else: width=8