Commit a1f7ee68 authored by Andreas Jung's avatar Andreas Jung

Collector #2409,2410: broken handling of quoted default argeuments in ZSQL...

Collector #2409,2410: broken handling of quoted default argeuments in ZSQL methods (wrong regular expression conversion)
parent bfb77406
......@@ -84,8 +84,8 @@
##############################################################################
__doc__='''Shared classes and functions
$Id: Aqueduct.py,v 1.49 2001/05/16 15:13:00 shane Exp $'''
__version__='$Revision: 1.49 $'[11:-2]
$Id: Aqueduct.py,v 1.50 2001/07/17 15:05:44 andreas Exp $'''
__version__='$Revision: 1.50 $'[11:-2]
import Globals, os
from Globals import Persistent
......@@ -340,6 +340,7 @@ class Args:
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 @@ def parse(text,
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]
......@@ -389,6 +395,7 @@ def parse(text,
return parse(text[l:],result,keys)
def quotedHTML(text,
character_entities=(
('&', '&'),
......
......@@ -85,11 +85,11 @@
__doc__='''Class for reading RDB files
$Id: RDB.py,v 1.30 2001/04/27 18:07:16 andreas Exp $'''
__version__='$Revision: 1.30 $'[11:-2]
$Id: RDB.py,v 1.31 2001/07/17 15:05:44 andreas Exp $'''
__version__='$Revision: 1.31 $'[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 @@ class DatabaseResults:
_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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment