minor improvement

This commit is contained in:
Miroslav Stampar
2010-12-26 11:15:02 +00:00
parent 22ce464efc
commit a555d1ad68
2 changed files with 8 additions and 3 deletions

View File

@@ -1355,7 +1355,7 @@ def initCommonOutputs():
cfile.close()
def getFileItems(filename, commentPrefix='#', unicode_=True):
def getFileItems(filename, commentPrefix='#', unicode_=True, lowercase=False, unique=False):
retVal = []
checkFile(filename)
@@ -1376,6 +1376,10 @@ def getFileItems(filename, commentPrefix='#', unicode_=True):
except UnicodeDecodeError:
continue
if line:
if lowercase:
line = line.lower()
if unique and line in retVal:
continue
retVal.append(line)
return retVal