fix an error due to a change in structure

This commit is contained in:
Kiryl
2021-10-04 13:48:37 +03:00
parent 594a8f0c8c
commit 236233fff1
3 changed files with 5 additions and 5 deletions

View File

@@ -16,4 +16,4 @@ VOLUME /app/logs
# VOLUME /app/html # VOLUME /app/html
# VOLUME /app/json # VOLUME /app/json
CMD python -m /app/src/util/check_dirs.py && python -m /app/consumer.py CMD python /app/src/util/check_dirs.py && python /app/consumer.py

View File

@@ -19,7 +19,7 @@ def configure_file_logger(name, filename='logs/converter_log.log', filemode='w+'
logging_format='%(asctime)s - %(levelname)s - %(message)s'): logging_format='%(asctime)s - %(levelname)s - %(message)s'):
logger = logging.getLogger(name) logger = logging.getLogger(name)
folder_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) folder_path = os.path.dirname(os.path.abspath(__file__))
file_path = os.path.join(folder_path, filename) file_path = os.path.join(folder_path, filename)
file_handler = logging.FileHandler(file_path, mode=filemode) file_handler = logging.FileHandler(file_path, mode=filemode)
@@ -84,7 +84,7 @@ def local_convert_book(filename, locker):
logger = configure_file_logger('consumer', logging_format='%(asctime)s - %(levelname)s - %(message)s') logger = configure_file_logger('consumer', logging_format='%(asctime)s - %(levelname)s - %(message)s')
logger.info(f'Start processing book-{filename}.') logger.info(f'Start processing book-{filename}.')
folder_path = os.path.dirname(os.path.dirname(os.path.abspath("__file__"))) folder_path = os.path.dirname(os.path.abspath("__file__"))
output_path = Path(os.path.join(folder_path, f'json/{filename}.json')) output_path = Path(os.path.join(folder_path, f'json/{filename}.json'))
try: try:
book = DocxBook(book_id=filename, book = DocxBook(book_id=filename,
@@ -114,7 +114,7 @@ def local_run(books):
def server_run(): def server_run():
logger = configure_file_logger('consumer') logger = configure_file_logger('consumer')
folder_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) folder_path = os.path.dirname(os.path.abspath(__file__))
config_path = Path(os.path.join(folder_path, "config/queue_config.json")) config_path = Path(os.path.join(folder_path, "config/queue_config.json"))
with open(config_path, "r") as f: with open(config_path, "r") as f:
conf_param = json.load(f) conf_param = json.load(f)

View File

@@ -3,7 +3,7 @@ from typing import Union
from ebooklib.epub import Section, Link from ebooklib.epub import Section, Link
from livecarta_config import LiveCartaConfig from src.livecarta_config import LiveCartaConfig
""" """
These are data structures which form mapping from NCX to python data structures. These are data structures which form mapping from NCX to python data structures.