Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix parameter mismatch in EPUBBookLoaderHelper.translate_with_ba… #429

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions book_maker/loader/helper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re
from copy import copy
import backoff
import logging
from copy import copy

logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -37,9 +37,10 @@ def insert_trans(self, p, text, translation_style="", single_translate=False):
Exception,
on_backoff=lambda details: logger.warning(f"retry backoff: {details}"),
on_giveup=lambda details: logger.warning(f"retry abort: {details}"),
jitter=None,
)
def translate_with_backoff(self, **kwargs):
return self.translate_model.translate(**kwargs)
def translate_with_backoff(self, text, context_flag=False):
return self.translate_model.translate(text, context_flag)

def deal_new(self, p, wait_p_list, single_translate=False):
self.deal_old(wait_p_list, single_translate, self.context_flag)
Expand Down
Loading