Change paths to books

This commit is contained in:
Kiryl
2022-07-27 20:44:19 +03:00
parent 253c4ebe26
commit af466cbc27
9 changed files with 62 additions and 60 deletions

View File

@@ -14,7 +14,7 @@ class DocxBook(BookSolver):
def __init__(self, book_id=0, access=None, main_logger=None, libre_locker=None):
super().__init__(book_id, access, main_logger)
self.book_type = 'docx'
self.book_type = "docx"
# critical section for occupying libreoffice by one thread
self.libre_locker: Event() = libre_locker
@@ -53,9 +53,9 @@ class DocxBook(BookSolver):
if __name__ == "__main__":
docx_file_path = '../../books/docx/music_inquiry.docx'
docx_file_path = "../../books/docx/music_inquiry.docx"
logger_object = BookLogger(
name='docx', book_id=docx_file_path.split('/')[-1])
name="docx", book_id=docx_file_path.split("/")[-1])
locker = Event()
locker.set()
@@ -70,5 +70,5 @@ if __name__ == "__main__":
content, footnotes, top_level_headers, logger_object)
content_dict = json_converter.convert_to_dict()
with codecs.open(docx_file_path.replace('docx', 'json'), 'w', encoding='utf-8') as f:
with codecs.open(docx_file_path.replace("docx", "json"), "w", encoding="utf-8") as f:
json.dump(content_dict, f, ensure_ascii=False)