mirror of
https://github.com/yihong0618/bilingual_book_maker.git
synced 2025-06-05 19:15:34 +00:00
parent
b387995f4d
commit
deedb946fe
@ -186,9 +186,9 @@ class BEPUB:
|
|||||||
new_book = self._make_new_book(self.origin_book)
|
new_book = self._make_new_book(self.origin_book)
|
||||||
all_items = list(self.origin_book.get_items())
|
all_items = list(self.origin_book.get_items())
|
||||||
all_p_length = sum(
|
all_p_length = sum(
|
||||||
len(bs(i.content, "html.parser").findAll("p"))
|
0
|
||||||
if i.file_name.endswith(".xhtml")
|
if i.get_type() != ITEM_DOCUMENT
|
||||||
else len(bs(i.content, "xml").findAll("p"))
|
else len(bs(i.content, "html.parser").findAll("p"))
|
||||||
for i in all_items
|
for i in all_items
|
||||||
)
|
)
|
||||||
pbar = tqdm(total=TEST_NUM) if IS_TEST else tqdm(total=all_p_length)
|
pbar = tqdm(total=TEST_NUM) if IS_TEST else tqdm(total=all_p_length)
|
||||||
@ -217,7 +217,7 @@ class BEPUB:
|
|||||||
self._save_progress()
|
self._save_progress()
|
||||||
# pbar.update(delta) not pbar.update(index)?
|
# pbar.update(delta) not pbar.update(index)?
|
||||||
pbar.update(1)
|
pbar.update(1)
|
||||||
if IS_TEST and index > TEST_NUM:
|
if IS_TEST and index >= TEST_NUM:
|
||||||
break
|
break
|
||||||
item.content = soup.prettify().encode()
|
item.content = soup.prettify().encode()
|
||||||
new_book.add_item(item)
|
new_book.add_item(item)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user