some update regarding common tables

This commit is contained in:
Miroslav Stampar
2010-10-29 09:00:51 +00:00
parent 895efd28a6
commit d75578c81f
4 changed files with 63 additions and 7 deletions

View File

@@ -1309,15 +1309,16 @@ def initCommonOutputs():
cfile.close()
def getFileItems(filename):
def getFileItems(filename, commentPrefix='#'):
retVal = []
checkFile(filename)
ifile = codecs.open(filename, 'r', conf.dataEncoding)
for line in ifile.readlines(): # xreadlines doesn't return unicode strings when codec.open() is used
if line.find('#') != -1:
line = line[:line.find('#')]
if commentPrefix:
if line.find(commentPrefix) != -1:
line = line[:line.find(commentPrefix)]
line = line.strip()
if line:
retVal.append(line)