epub converter: add internal links processing2

This commit is contained in:
shirshasa
2021-05-26 08:15:56 +03:00
parent 3eac136e07
commit 836e2dbc11
3 changed files with 35 additions and 12 deletions

View File

@@ -113,9 +113,16 @@ class EpubBook:
self.book_api_wrapper.set_process_status()
self.logger_object.log('Beginning of processing json output.')
json_converter = EpubPostprocessor(self.epub_path, access=self.access, logger=self.logger_object)
content_dict = json_converter.convert_to_dict()
self.book_api_wrapper.set_generate_status()
self.write_to_json(content_dict)
self.send_json_content(content_dict)
self.logger_object.log(f'End of the conversion to LawCarta format. Check {self.output_path}.')
try:
json_converter = EpubPostprocessor(self.epub_path, access=self.access, logger=self.logger_object)
content_dict = json_converter.convert_to_dict()
self.book_api_wrapper.set_generate_status()
self.write_to_json(content_dict)
self.send_json_content(content_dict)
self.logger_object.log(f'End of the conversion to LawCarta format. Check {self.output_path}.')
except Exception as exc:
self.logger_object.log('Error has occurred while conversion.', logging.ERROR)
self.logger_object.log_error_to_main_log(str(exc))
self.book_api_wrapper.set_error_status()
raise exc