'Return an appropriate LangInfo for the given filename, or None.'

def langinfo_from_filename(self, filename):

    if (self._langinfo_from_filename is None):
        self._build_tables()
    if (filename in self._langinfo_from_filename):
        return self._langinfo_from_filename[filename]
    else:
        for (regex, li) in self._langinfo_from_filename_re.items():
            if regex.search(filename):
                return li
