From 213986101853ea70ce8c30ff0f3deb820b46eb91 Mon Sep 17 00:00:00 2001 From: Liam Bigelow <40188355+bglw@users.noreply.github.com> Date: Mon, 30 Sep 2024 10:44:59 +1300 Subject: [PATCH] Python formatting --- wrappers/python/src/pagefind/index/__init__.py | 7 ++----- wrappers/python/src/pagefind/service/types.py | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/wrappers/python/src/pagefind/index/__init__.py b/wrappers/python/src/pagefind/index/__init__.py index 4b108182..68e04371 100644 --- a/wrappers/python/src/pagefind/index/__init__.py +++ b/wrappers/python/src/pagefind/index/__init__.py @@ -171,7 +171,7 @@ async def get_files(self) -> List[InternalDecodedFile]: files = cast(InternalGetFilesResponse, response)["files"] decoded_files = [ - {'path': file['path'], 'content': base64.b64decode(file['content'])} + {"path": file["path"], "content": base64.b64decode(file["content"])} for file in files ] @@ -229,10 +229,7 @@ async def add_custom_record( assert result["type"] == "IndexedFile" return cast(InternalIndexedFileResponse, result) - async def write_files( - self, - output_path: Optional[str] = None - ) -> None: + async def write_files(self, output_path: Optional[str] = None) -> None: """Write the index files to disk. If you're using PagefindIndex as a context manager, there's no need to call this method: diff --git a/wrappers/python/src/pagefind/service/types.py b/wrappers/python/src/pagefind/service/types.py index 1930a8d9..03ee6943 100644 --- a/wrappers/python/src/pagefind/service/types.py +++ b/wrappers/python/src/pagefind/service/types.py @@ -132,10 +132,12 @@ class InternalSyntheticFile(TypedDict): path: str content: str + class InternalDecodedFile(TypedDict): path: str content: bytes + class InternalGetFilesResponse(TypedDict): type: Literal["GetFiles"] files: List[InternalSyntheticFile]