def test_exos_liste(self): # 1) parsing parser = Parser() # BREAKPOINT >>> # import pdb; pdb.set_trace() # <<< BREAKPOINT # doc = parser.parse_from_file("../examples/exosliste.tango.tex") # 2) processing processor = DocumentProcessor(doc) core.register_core_processors(processor) py_ctx = codeactive.PythonContext(dict()) codeactive.register_processors(processor, py_ctx) try: processor.process() except codeactive.CheckPythonFailure: print("CheckPython failed, aborpting ...") return #print("After process = \n" + str(doc)) # 3) generating latex_config = LatexConfiguration() latex_config.document_class = "article" generator = LatexDocumentGenerator(doc, latex_config) generator.generate()
def test_basic_example(self): parser = Parser() # BREAKPOINT >>> # import pdb; pdb.set_trace() # <<< BREAKPOINT # ret = parser.parse_from_file("../examples/basic.tango.tex") print(ret)
def test_count_item(self): parser = Parser() # BREAKPOINT >>> # import pdb; pdb.set_trace() # <<< BREAKPOINT # doc = parser.parse_from_file("../examples/basic.tango.tex") processor = DocumentProcessor(doc) count = TestCommandProcess.CountItem() processor.register_command_processor("item",count) processor.process() #print("count = {}".format(count.count)) self.assertEqual(count.count, 5)
def test_basic_example(self): # 1) parsing parser = Parser() # BREAKPOINT >>> # import pdb; pdb.set_trace() # <<< BREAKPOINT # doc = parser.parse_from_file("../examples/basic.tango.tex") # 2) processing processor = DocumentProcessor(doc) core.register_core_processors(processor) processor.process() # 3) generating latex_config = LatexConfiguration() latex_config.document_class = "article" generator = LatexDocumentGenerator(doc, latex_config) generator.generate() print("Output =\n" + str(generator.output))
if enable_write_phase: tangoPrintln("Write phase enabled") tangolib.globalvars.init_global_vars() import os tangoPrintln("Current work directory = '{}'".format(os.getcwd())) # 1) parsing parser = Parser() tangoPrintln("Parsing from file '{}' ...".format(args.input_filename)) doc = parser.parse_from_file(args.input_filename) tangoPrintln("==> parsing done.") # 2) processing if enable_process_phase: tangoPrintln("Processing phase ...") processor = DocumentProcessor(doc) core.register_core_processors(processor) # support for active python code if args.code_active: tangoPrintln("Enabling active python code processors")