'Parse a configuration file
If file is None and self.defaultFilename is set, it will open
defaultFilename and use it.'

def parseFile(self, file=None):

    close = False
    if ((file is None) and self.defaultFilename):
        file = open(self.defaultFilename, 'r')
        close = True
    try:
        for line in file.readlines():
            comment = line.find(self.commentChar)
            if (comment != (-1)):
                line = line[:comment]
            line = line.strip()
            if (not line):
                continue
            self.parseLine(line)
    finally:
        if close:
            file.close()
