def open_resource(self, path: FilePath, mode: str='rb') -> IO[AnyStr]:
        """Open a file for reading.

        Use as

        .. code-block:: python

            with app.open_resouce(path) as file_:
                file_.read()
        """
        if mode not in {'r', 'rb'}:
            raise ValueError('Files can only be opened for reading')
        return open(self.root_path / file_path_to_path(path), mode)
def open_resource ( self , path : FilePath , mode : str = 'rb' ) -> IO [ AnyStr ] : if mode not in { 'r' , 'rb' } : raise ValueError ( 'Files can only be opened for reading' ) return open ( self . root_path / file_path_to_path ( path ) , mode )
Open a file for reading.

        Use as

        .. code-block:: python

            with app.open_resouce(path) as file_:
                file_.read()