Beispiel #1
0
    def sfilter(self, source):
        """Filter."""

        return [
            filters.SourceText(self._filter(source.text), source.context,
                               source.encoding, "text")
        ]
Beispiel #2
0
    def filter(self, source_file, encoding):  # noqa A001
        """Parse text file."""

        with codecs.open(source_file, "r", encoding=encoding) as fobj:
            text = fobj.read()
        return [
            filters.SourceText(self._filter(text), source_file, encoding,
                               "text")
        ]