Skip to content

Commit

Permalink
🔥 feat!: remove deprecated API Danmaku2ASS
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo committed Nov 9, 2024
1 parent 3286c56 commit d9337c8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 40 deletions.
1 change: 0 additions & 1 deletion packages/biliass/src/biliass/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@

from .biliass import (
BlockOptions as BlockOptions,
Danmaku2ASS as Danmaku2ASS,
convert_to_ass as convert_to_ass,
)
40 changes: 1 addition & 39 deletions packages/biliass/src/biliass/biliass.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,11 @@
)

if TYPE_CHECKING:
from collections.abc import Callable, Sequence
from collections.abc import Sequence

T = TypeVar("T")


def Danmaku2ASS(
inputs: Sequence[str | bytes] | str | bytes,
stage_width: int,
stage_height: int,
input_format: str = "xml",
reserve_blank: int = 0,
font_face: str = "sans-serif",
font_size: float = 25.0,
text_opacity: float = 1.0,
duration_marquee: float = 5.0,
duration_still: float = 5.0,
comment_filter: str | None = None,
is_reduce_comments: bool = False,
progress_callback: Callable[[int, int], None] | None = None,
) -> str:
print(
"Function `Danmaku2ASS` is deprecated in biliass 2.0.0 and will be removed in 2.2.0, Please use `convert_to_ass` instead."
)
if progress_callback is not None:
print("`progress_callback` will take no effect in 2.0.0")
comment_filters: list[str] = [comment_filter] if comment_filter is not None else []
block_options = BlockOptions(False, False, False, False, False, False, comment_filters)
return convert_to_ass(
inputs,
stage_width,
stage_height,
input_format,
1 - reserve_blank / stage_height,
font_face,
font_size,
text_opacity,
duration_marquee,
duration_still,
block_options,
is_reduce_comments,
)


def convert_to_ass(
inputs: Sequence[str | bytes] | str | bytes,
stage_width: int,
Expand Down

0 comments on commit d9337c8

Please sign in to comment.