From: <de...@us...> - 2003-05-30 00:54:36
|
Update of /cvsroot/pymerase/pymerase/pymerase/input In directory sc8-pr-cvs1:/tmp/cvs-serv20337 Modified Files: parseGenexSchemaXML.py Log Message: Fixed bug where pymerase would crash if <unique column_id /> named a column that didn't exist. Renamed some variables to make more sense Changed a print statement to an appropriate warning. Index: parseGenexSchemaXML.py =================================================================== RCS file: /cvsroot/pymerase/pymerase/pymerase/input/parseGenexSchemaXML.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** parseGenexSchemaXML.py 25 Apr 2003 23:52:56 -0000 1.28 --- parseGenexSchemaXML.py 30 May 2003 00:54:32 -0000 1.29 *************** *** 201,205 **** self.current_pathname = pathname # create parser - #print sax2exts.XMLParserFactory.get_parser_list() parser = sax2exts.make_parser() --- 201,204 ---- *************** *** 376,384 **** elif name == "unique": # get the list of unique fields and set an inidcator flag ! class_names = attributes['column_ids'] ! class_name_list = re.split("\s+", class_names) ! for class_name in class_name_list: ! classAttribute = self.currentTable.getAttributeByName(class_name, None) ! classAttribute.setUnique(1) elif name == "index": --- 375,390 ---- elif name == "unique": # get the list of unique fields and set an inidcator flag ! attribute_names = attributes['column_ids'] ! attribute_name_list = re.split("\s+", attribute_names) ! for attribute_name in attribute_name_list: ! classAttribute = self.currentTable.getAttributeByName(attribute_name, None) ! if classAttribute is None: ! warn("In %s attribute %s was declared unique but not found among %s" % ( ! self.current_pathname, ! attribute_name, ! str(self.currentTable.getAttributeNames(None))), ! SyntaxWarning) ! else: ! classAttribute.setUnique(1) elif name == "index": *************** *** 396,400 **** self.currentTable = None else: ! print "syntax error: table %s not defined" % (self.currentTable.getName(None)) --- 402,407 ---- self.currentTable = None else: ! warn("syntax error: table %s not defined" %(self.currentTable.getName(None)), ! SyntaxWarning) *************** *** 418,422 **** if element.getDefined() == 0: errors += 1 ! warn(RuntimeWarning, "SyntaxError: %s was not defined" % (element.getName(None))) if errors > 0: --- 425,430 ---- if element.getDefined() == 0: errors += 1 ! warn("SyntaxError: %s was not defined" % (element.getName(None)), ! RuntimeWarning) if errors > 0: |