Skip to content

Commit

Permalink
Python formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bglw committed Sep 29, 2024
1 parent 6b4684a commit 2139861
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 2 additions & 5 deletions wrappers/python/src/pagefind/index/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions wrappers/python/src/pagefind/service/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 2139861

Please sign in to comment.