Update of /cvsroot/webware/Webware/MiddleKit/Design
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23853/Design
Modified Files:
SQLGenerator.py
Log Message:
- made the 'objects' declaration in the samples case-insensitive
- give an error message (instead of a stack dump) when attr labels or
data are encountered without a previous 'objects' declaration
Index: SQLGenerator.py
===================================================================
RCS file: /cvsroot/webware/Webware/MiddleKit/Design/SQLGenerator.py,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** SQLGenerator.py 12 Mar 2004 23:46:11 -0000 1.52
--- SQLGenerator.py 19 Mar 2004 20:21:27 -0000 1.53
***************
*** 147,150 ****
--- 147,151 ----
parse = CSVParser.CSVParser().parse
linenum = 0
+ klass = None
for line in lines:
linenum += 1
***************
*** 161,165 ****
if fields[0] and str(fields[0])[0]=='#':
continue
! if fields[0].endswith(' objects'):
klassName = fields[0].split()[0]
try:
--- 162,166 ----
if fields[0] and str(fields[0])[0]=='#':
continue
! if fields[0].lower().endswith(' objects'):
klassName = fields[0].split()[0]
try:
***************
*** 176,179 ****
--- 177,182 ----
continue
if readColumns:
+ if klass is None:
+ raise SampleError(linenum, "Have not yet seen an 'objects' declaration.")
names = [name for name in fields if name]
attrs = []
***************
*** 194,197 ****
--- 197,202 ----
readColumns = 0
continue
+ if klass is None:
+ raise SampleError(linenum, "Have not yet seen an 'objects' declaration.")
values = fields[:len(attrs)]
i = 0
|