Add more detailed runtime messages

This commit is contained in:
stephenmk 2023-07-10 21:18:40 -05:00
parent 227c02b9e4
commit ce2e106646
No known key found for this signature in database
GPG key ID: B6DA730DB06235F1
4 changed files with 4 additions and 1 deletions

View file

@ -3,7 +3,7 @@ import re
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
import bot.scraper as Scraper import bot.crawlers.scraper as Scraper
from bot.entries.factory import new_entry from bot.entries.factory import new_entry
from bot.yomichan.exporters.factory import new_yomi_exporter from bot.yomichan.exporters.factory import new_yomi_exporter
from bot.mdict.exporters.factory import new_mdict_exporter from bot.mdict.exporters.factory import new_mdict_exporter

View file

@ -36,6 +36,7 @@ class Exporter(ABC):
return self._build_dir return self._build_dir
cache_dir = user_cache_dir("jitenbot") cache_dir = user_cache_dir("jitenbot")
build_directory = os.path.join(cache_dir, "mdict_build") build_directory = os.path.join(cache_dir, "mdict_build")
print(f"Initializing build directory `{build_directory}`")
if Path(build_directory).is_dir(): if Path(build_directory).is_dir():
shutil.rmtree(build_directory) shutil.rmtree(build_directory)
os.makedirs(build_directory) os.makedirs(build_directory)
@ -121,6 +122,7 @@ class Exporter(ABC):
return self._out_dir return self._out_dir
out_dir = os.path.join( out_dir = os.path.join(
user_documents_dir(), "jitenbot", "mdict", self._target.value) user_documents_dir(), "jitenbot", "mdict", self._target.value)
print(f"Initializing output directory `{out_dir}`")
if Path(out_dir).is_dir(): if Path(out_dir).is_dir():
shutil.rmtree(out_dir) shutil.rmtree(out_dir)
os.makedirs(out_dir) os.makedirs(out_dir)

View file

@ -42,6 +42,7 @@ class Exporter(ABC):
return self._build_dir return self._build_dir
cache_dir = user_cache_dir("jitenbot") cache_dir = user_cache_dir("jitenbot")
build_directory = os.path.join(cache_dir, "yomichan_build") build_directory = os.path.join(cache_dir, "yomichan_build")
print(f"Initializing build directory `{build_directory}`")
if Path(build_directory).is_dir(): if Path(build_directory).is_dir():
shutil.rmtree(build_directory) shutil.rmtree(build_directory)
os.makedirs(build_directory) os.makedirs(build_directory)