mirror of
https://github.com/yihong0618/bilingual_book_maker.git
synced 2025-06-05 19:15:34 +00:00
fix: lint
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
parent
cb3779f279
commit
bd46bc0c6c
@ -465,29 +465,33 @@ class EPUBBookLoader(BaseBookLoader):
|
|||||||
all_items = list(self.origin_book.get_items())
|
all_items = list(self.origin_book.get_items())
|
||||||
trans_taglist = self.translate_tags.split(",")
|
trans_taglist = self.translate_tags.split(",")
|
||||||
all_p_length = sum(
|
all_p_length = sum(
|
||||||
0
|
(
|
||||||
if (
|
0
|
||||||
(i.get_type() != ITEM_DOCUMENT)
|
if (
|
||||||
or (i.file_name in self.exclude_filelist.split(","))
|
(i.get_type() != ITEM_DOCUMENT)
|
||||||
or (
|
or (i.file_name in self.exclude_filelist.split(","))
|
||||||
self.only_filelist
|
or (
|
||||||
and i.file_name not in self.only_filelist.split(",")
|
self.only_filelist
|
||||||
|
and i.file_name not in self.only_filelist.split(",")
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
else len(bs(i.content, "html.parser").findAll(trans_taglist))
|
||||||
)
|
)
|
||||||
else len(bs(i.content, "html.parser").findAll(trans_taglist))
|
|
||||||
for i in all_items
|
for i in all_items
|
||||||
)
|
)
|
||||||
all_p_length += self.allow_navigable_strings * sum(
|
all_p_length += self.allow_navigable_strings * sum(
|
||||||
0
|
(
|
||||||
if (
|
0
|
||||||
(i.get_type() != ITEM_DOCUMENT)
|
if (
|
||||||
or (i.file_name in self.exclude_filelist.split(","))
|
(i.get_type() != ITEM_DOCUMENT)
|
||||||
or (
|
or (i.file_name in self.exclude_filelist.split(","))
|
||||||
self.only_filelist
|
or (
|
||||||
and i.file_name not in self.only_filelist.split(",")
|
self.only_filelist
|
||||||
|
and i.file_name not in self.only_filelist.split(",")
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
else len(bs(i.content, "html.parser").findAll(text=True))
|
||||||
)
|
)
|
||||||
else len(bs(i.content, "html.parser").findAll(text=True))
|
|
||||||
for i in all_items
|
for i in all_items
|
||||||
)
|
)
|
||||||
pbar = tqdm(total=self.test_num) if self.is_test else tqdm(total=all_p_length)
|
pbar = tqdm(total=self.test_num) if self.is_test else tqdm(total=all_p_length)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
inspired by: https://github.com/jesselau76/srt-gpt-translator, MIT License
|
inspired by: https://github.com/jesselau76/srt-gpt-translator, MIT License
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
2
setup.py
2
setup.py
@ -18,7 +18,7 @@ packages = [
|
|||||||
setup(
|
setup(
|
||||||
name="bbook_maker",
|
name="bbook_maker",
|
||||||
description="The bilingual_book_maker is an AI translation tool that uses ChatGPT to assist users in creating multi-language versions of epub/txt files and books.",
|
description="The bilingual_book_maker is an AI translation tool that uses ChatGPT to assist users in creating multi-language versions of epub/txt files and books.",
|
||||||
version="0.7.1",
|
version="0.7.2",
|
||||||
license="MIT",
|
license="MIT",
|
||||||
author="yihong0618",
|
author="yihong0618",
|
||||||
author_email="zouzou0208@gmail.com",
|
author_email="zouzou0208@gmail.com",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user