# HG changeset patch # User Nicolas Saunier # Date 1285429122 14400 # Node ID 3aed17fc468d2f0e61c9064e9c20a8a7dd85b460 # Parent 7b06d649122b6a6419d03cee814e6c3f41a02c55 utils to save object types diff -r 7b06d649122b -r 3aed17fc468d python/ubc_utils.py --- a/python/ubc_utils.py Sat Sep 25 11:36:37 2010 -0400 +++ b/python/ubc_utils.py Sat Sep 25 11:38:42 2010 -0400 @@ -6,6 +6,12 @@ __metaclass__ = type +userTypeNames = ['car', + 'pedestrian', + 'twowheels', + 'bus' + 'truck'] + def getFileType(s): filePrefix = utils.removeExtension(s) i = filePrefix.rfind('-') @@ -20,9 +26,9 @@ from the inFilename, and saving the characteristics in objects (first line) into outFilename''' infile = utils.openCheck(inFilename) - outfile = utils.openCheck(outFilename) + outfile = utils.openCheck(outFilename,'w') - if (not infile) | (not outfile): + if (inFilename.find('features') >= 0) or (not infile) or (not outfile): return lines = utils.getLines(infile) @@ -33,11 +39,17 @@ i+=1 if i