diff --git a/Dockerfile b/Dockerfile index eb5c1f3..7657bff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,4 +16,4 @@ VOLUME /app/logs # VOLUME /app/html # VOLUME /app/json -CMD python -m /app/src/util/check_dirs.py && python -m /app/consumer.py \ No newline at end of file +CMD python /app/src/util/check_dirs.py && python /app/consumer.py \ No newline at end of file diff --git a/consumer.py b/consumer.py index 659d5f8..7cc53c0 100644 --- a/consumer.py +++ b/consumer.py @@ -19,7 +19,7 @@ def configure_file_logger(name, filename='logs/converter_log.log', filemode='w+' logging_format='%(asctime)s - %(levelname)s - %(message)s'): 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_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.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')) try: book = DocxBook(book_id=filename, @@ -114,7 +114,7 @@ def local_run(books): def server_run(): 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")) with open(config_path, "r") as f: conf_param = json.load(f) diff --git a/src/data_objects.py b/src/data_objects.py index df5d1f3..efd8f0b 100644 --- a/src/data_objects.py +++ b/src/data_objects.py @@ -3,7 +3,7 @@ from typing import Union 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.