Browse Source

Fix logging

pull/19/head
Michel Roux 4 months ago
parent
commit
a69acf171c
  1. 7
      gravesong.py
  2. 7
      twi.py

7
gravesong.py

@ -1,5 +1,6 @@
import bs4
import executor
import logging
import pypub
import requests
@ -26,7 +27,7 @@ def process(metadata, output_dir):
for paragraph in entry_content.children:
if paragraph.name == "h1":
print(f"Gravesong - {chapter_title}")
logging.log(logging.INFO, f"Gravesong - {chapter_title}")
book.add_chapter(
pypub.create_chapter_from_string(chapter_content, chapter_title)
)
@ -34,8 +35,8 @@ def process(metadata, output_dir):
elif paragraph.name == "p":
chapter_content += paragraph.prettify()
print(f"Gravesong - {chapter_title}")
logging.log(logging.INFO, f"Gravesong - {chapter_title}")
book.add_chapter(pypub.create_chapter_from_string(chapter_content, chapter_title))
print("Gravesong - Book")
logging.log(logging.INFO, "Gravesong - Book")
book.create_epub(output_dir)

7
twi.py

@ -1,6 +1,7 @@
import asyncio
import executor
import bs4
import executor
import logging
import pypub
import requests
@ -25,12 +26,12 @@ def fetchVolume(title, metadata, volume_title, output_dir, links):
for removed in div_remove:
removed.decompose()
print(f"{title} - {chapter_title}")
logging.log(logging.INFO, f"{title} - {chapter_title}")
book.add_chapter(
pypub.create_chapter_from_string(chapter_content.prettify(), chapter_title)
)
print(f"{title} - {volume_title}")
logging.log(logging.INFO, f"{title} - {volume_title}")
book.create_epub(output_dir)

Loading…
Cancel
Save