[Zope-Checkins] CVS: Zope2 - Aqueduct.py:1.50 RDB.py:1.31
andreas@korak.zope.com
andreas@korak.zope.com
Tue, 17 Jul 2001 11:05:44 -0400
Update of /cvs-repository/Zope2/lib/python/Shared/DC/ZRDB
In directory korak.zope.com:/tmp/cvs-serv14102
Modified Files:
Aqueduct.py RDB.py
Log Message:
Collector #2409,2410: broken handling of quoted default argeuments in ZSQL methods (wrong regular expression conversion)
--- Updated File Aqueduct.py in package Zope2 --
--- Aqueduct.py 2001/05/16 15:13:00 1.49
+++ Aqueduct.py 2001/07/17 15:05:44 1.50
@@ -340,6 +340,7 @@
def __delitem__(self, key): del self._data[key]
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=(
--- Updated File RDB.py in package Zope2 --
--- RDB.py 2001/04/27 18:07:16 1.30
+++ RDB.py 2001/07/17 15:05:44 1.31
@@ -89,7 +89,7 @@
__version__='$Revision$'[11:-2]
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