def __init__(self): self.config_folder = ServiceLocator.get_config_folder() self.doc_regex = ServiceLocator.get_build_log_doc_regex() self.item_regex = ServiceLocator.get_build_log_item_regex() self.badbox_line_number_regex = ServiceLocator.get_build_log_badbox_line_number_regex( ) self.other_line_number_regex = ServiceLocator.get_build_log_other_line_number_regex( ) self.bibtex_log_item_regex = ServiceLocator.get_bibtex_log_item_regex() self.process = None
def __init__(self, text, tex_filename, latex_interpreter, use_latexmk, additional_arguments, do_cleanup, synctex_arguments): Query.__init__(self) self.text = text self.tex_filename = tex_filename self.new_pdf_filename = os.path.splitext(self.tex_filename)[0] + '.pdf' self.directory_name = os.path.dirname(self.tex_filename) self.synctex_args = synctex_arguments self.additional_arguments = additional_arguments self.do_cleanup = do_cleanup self.log_messages = list() self.bibtex_log_messages = list() self.doc_regex = ServiceLocator.get_build_log_doc_regex() self.item_regex = ServiceLocator.get_build_log_item_regex() self.badbox_line_number_regex = ServiceLocator.get_build_log_badbox_line_number_regex( ) self.other_line_number_regex = ServiceLocator.get_build_log_other_line_number_regex( ) self.bibtex_log_item_regex = ServiceLocator.get_bibtex_log_item_regex() self.forward_synctex_regex = ServiceLocator.get_forward_synctex_regex() self.force_building_to_stop = False self.latex_interpreter = latex_interpreter self.build_command_defaults = dict() self.build_command_defaults[ 'pdflatex'] = 'pdflatex -synctex=1 -interaction=nonstopmode -pdf' self.build_command_defaults[ 'xelatex'] = 'xelatex -synctex=1 -interaction=nonstopmode' self.build_command_defaults[ 'lualatex'] = 'lualatex --synctex=1 --interaction=nonstopmode' if use_latexmk: if self.latex_interpreter == 'pdflatex': interpreter_option = 'pdf' else: interpreter_option = self.latex_interpreter self.build_command = 'latexmk -' + interpreter_option + ' -synctex=1 -interaction=nonstopmode' + self.additional_arguments else: self.build_command = self.build_command_defaults[ self.latex_interpreter] + self.additional_arguments self.do_another_latex_build = True self.do_a_bibtex_build = False self.done_bibtex_build = False self.error_count = 0