Skip to content

Commit

Permalink
Ditches annotated
Browse files Browse the repository at this point in the history
  • Loading branch information
stumpylog committed Sep 30, 2024
1 parent ff4c45f commit 484453c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
26 changes: 17 additions & 9 deletions src/gotenberg_client/_convert/chromium.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# SPDX-License-Identifier: MPL-2.0
import logging
from pathlib import Path
from typing import Annotated
from typing import List
from typing import Literal
from typing import Optional
Expand Down Expand Up @@ -77,16 +76,25 @@ def resources(self, resources: List[Path]) -> Self:

def string_resources(
self,
resources: List[
Tuple[
Annotated[str, "Resource Data"],
Annotated[str, "Resource Filename"],
Optional[Annotated[str, "Resource Mime-Type"]],
]
],
resources: List[Tuple[str, str, Optional[str]]],
) -> Self:
"""
Adds the given resources for the index HTML file to reference.
Process string resources.
This method takes a list of resource tuples and processes them.
Args:
resources: A list of resource tuples.
Each tuple contains:
- str: Resource Data - The content or data of the resource.
- str: Resource Filename - The filename of the resource for reference in the index
- Optional[str]: Resource mimetype - The MIME type of the resource, if available.
Returns:
Self: Returns the instance of the class for method chaining.
Note:
The third element of each tuple (Resource Mime-Type) is optional.
"""
for resource, name, mime_type in resources:
self._add_in_memory_file(resource, name=name, mime_type=mime_type)
Expand Down
5 changes: 0 additions & 5 deletions src/gotenberg_client/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
else: # pragma: no cover
from typing_extensions import Self # noqa: F401

if sys.version_info > (3, 8): # pragma: no cover
from typing import Annotated
else: # pragma: no cover
from typing_extensions import Annotated # noqa: F401

WaitTimeType = Union[float, int]
FormFieldType = Union[bool, int, float, str]
PageSizeType = Union[float, int]
Expand Down

0 comments on commit 484453c

Please sign in to comment.