MCPcopy Create free account
hub / github.com/pallets/quart / open_instance_resource

Method open_instance_resource

src/quart/app.py:408–420  ·  view source on GitHub ↗

Open a file for reading. Use as .. code-block:: python async with await app.open_instance_resource(path) as file_: await file_.read()

(
        self, path: FilePath, mode: str = "rb"
    )

Source from the content-addressed store, hash-verified

406 return async_open(os.path.join(self.root_path, path), mode) # type: ignore
407
408 async def open_instance_resource(
409 self, path: FilePath, mode: str = "rb"
410 ) -> AiofilesContextManager:
411 """Open a file for reading.
412
413 Use as
414
415 .. code-block:: python
416
417 async with await app.open_instance_resource(path) as file_:
418 await file_.read()
419 """
420 return async_open(self.instance_path / file_path_to_path(path), mode) # type: ignore
421
422 def create_jinja_environment(self) -> Environment: # type: ignore
423 """Create and return the jinja environment.

Callers

nothing calls this directly

Calls 1

file_path_to_pathFunction · 0.85

Tested by

no test coverage detected