MCPcopy
hub / github.com/encode/starlette / __init__

Method __init__

starlette/staticfiles.py:40–56  ·  view source on GitHub ↗
(
        self,
        *,
        directory: PathLike | None = None,
        packages: list[str | tuple[str, str]] | None = None,
        html: bool = False,
        check_dir: bool = True,
        follow_symlink: bool = False,
    )

Source from the content-addressed store, hash-verified

38
39class StaticFiles:
40 def __init__(
41 self,
42 *,
43 directory: PathLike | None = None,
44 packages: list[str | tuple[str, str]] | None = None,
45 html: bool = False,
46 check_dir: bool = True,
47 follow_symlink: bool = False,
48 ) -> None:
49 self.directory = directory
50 self.packages = packages
51 self.all_directories = self.get_directories(directory, packages)
52 self.html = html
53 self.config_checked = False
54 self.follow_symlink = follow_symlink
55 if check_dir and directory is not None and not os.path.isdir(directory):
56 raise RuntimeError(f"Directory '{directory}' does not exist")
57
58 def get_directories(
59 self,

Callers 1

__init__Method · 0.45

Calls 1

get_directoriesMethod · 0.95

Tested by

no test coverage detected