(self, filename, file_handle=None)
Main entry point - call with a filename and optionally the file handle to read from.
Main entry point - call with a filename and optionally the file handle to read from.
Main entry point - call with a filename and optionally the file handle to read from .
def process_file(self, filename, file_handle=None):
        """Main entry point - call with a filename and optionally the file handle to read from."""
        if isinstance(filename, str):
            filename = Path(filename).resolve()

        self._filename = filename

        if file_handle:
            self._process_file_handle(file_handle)
        else:
            with self._filename.open('r', encoding='utf-8') as f:
                self._process_file_handle(f)
def process_file ( self , filename , file_handle = None ) : if isinstance ( filename , str ) : filename = Path ( filename ) . resolve ( ) self . _filename = filename if file_handle : self . _process_file_handle ( file_handle ) else : with self . _filename . open ( 'r' , encoding = 'utf-8' ) as f : self . _process_file_handle ( f )