comparison seg2matrix/CGData/BaseTable.py @ 59:b88b95642f59

fix
author jingchunzhu
date Tue, 22 Sep 2015 15:41:03 -0700
parents 3a036a34c362
children
comparison
equal deleted inserted replaced
58:3e5680fecd7a 59:b88b95642f59
73 if 'columnDef' in self['cgformat'] and col in self['cgformat']['columnDef'] and 'optional' in self['cgformat']['columnDef'][col]: 73 if 'columnDef' in self['cgformat'] and col in self['cgformat']['columnDef'] and 'optional' in self['cgformat']['columnDef'][col]:
74 isOptional = self['cgformat']['columnDef'][col]['optional'] 74 isOptional = self['cgformat']['columnDef'][col]['optional']
75 if len(row) > i: 75 if len(row) > i:
76 try: 76 try:
77 setattr(r, col, colType[col](row[i])) 77 setattr(r, col, colType[col](row[i]))
78 except ValueError: 78 except ValueError:
79 skip=1
80 break
79 raise ValueError( "col invalid type %s on line %d" % (row[i], linenum)) 81 raise ValueError( "col invalid type %s on line %d" % (row[i], linenum))
80 else: 82 else:
81 if isOptional: 83 if isOptional:
82 setattr(r, col, None) 84 setattr(r, col, None)
83 else: 85 else: