def METHOD_NAME(self, file=None):
    """
    Parse a configuration file
    If file is None and self.defaultFilename is set, it will open
    defaultFilename and use it.
    """
    close = False
    if file is None and self.defaultFilename:
        file = open(self.defaultFilename)
        close = True
    try:
        for line in file.readlines():
            # Strip out comments
            comment = line.find(self.commentChar)
            if comment != -1:
                line = line[:comment]
            # Strip whitespace
            line = line.strip()
            # Skip empty lines (and lines which only contain comments)
            if not line:
                continue
            self.parseLine(line)
    finally:
        if close:
            file.close()