forked from LiveCarta/BookConverter
Add local convert
This commit is contained in:
@@ -137,3 +137,15 @@ class BookSolver:
|
|||||||
self.logger_object.log_error_to_main_log(str(exc))
|
self.logger_object.log_error_to_main_log(str(exc))
|
||||||
raise 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
|
||||||
@@ -8,7 +8,7 @@ from threading import Event
|
|||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from html_docx_preprocessor import HTMLDocxPreprocessor
|
from html_docx_preprocessor import HTMLDocxPreprocessor
|
||||||
from libra_html2json_converter import LibraHTML2JSONConverter
|
from libra_html2json_converter import LibraHTML2JSONConverter
|
||||||
from src.solver import BookSolver
|
from src.book_solver import BookSolver
|
||||||
|
|
||||||
|
|
||||||
class DocxBook(BookSolver):
|
class DocxBook(BookSolver):
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from epub_converter import EpubConverter
|
from epub_converter import EpubConverter
|
||||||
from src.solver import BookSolver
|
from src.book_solver import BookSolver
|
||||||
|
|
||||||
|
|
||||||
class EpubBook(BookSolver):
|
class EpubBook(BookSolver):
|
||||||
|
|||||||
Reference in New Issue
Block a user