Fix logging
continuous-integration/drone/push Build was killed Details

This commit is contained in:
Michel Roux 2022-01-18 21:05:00 +00:00
parent d637c74628
commit a69acf171c
2 changed files with 8 additions and 6 deletions

View File

@ -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
View File

@ -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)