Add local convert

This commit is contained in:
Kiryl
2021-09-22 15:59:49 +03:00
parent c361a0b9a5
commit 331b70316b
3 changed files with 14 additions and 2 deletions

View File

@@ -137,3 +137,15 @@ class BookSolver:
self.logger_object.log_error_to_main_log(str(exc))
raise exc
def conversion_local(self):
try:
with open('tmp.json') as f:
d = json.load(f)
self.send_json_content_to_server(d)
self.logger_object.log(f'End of the conversion to LawCarta format. Check {self.output_path}.')
except Exception as exc:
self.status_wrapper.set_error()
self.logger_object.log('Error has occurred while conversion.', logging.ERROR)
self.logger_object.log_error_to_main_log(str(exc))
raise exc

View File

@@ -8,7 +8,7 @@ from threading import Event
from bs4 import BeautifulSoup
from html_docx_preprocessor import HTMLDocxPreprocessor
from libra_html2json_converter import LibraHTML2JSONConverter
from src.solver import BookSolver
from src.book_solver import BookSolver
class DocxBook(BookSolver):

View File

@@ -1,5 +1,5 @@
from epub_converter import EpubConverter
from src.solver import BookSolver
from src.book_solver import BookSolver
class EpubBook(BookSolver):