def main(): cf.active = cf.Version1() doc = Document(data=NoEscape(lorem)) doc.generate_pdf('config1_with_indent', clean_tex=False) cf.active = cf.Version1(indent=False) doc = Document(data=NoEscape(lorem)) doc.generate_pdf('config2_without_indent', clean_tex=False) with cf.Version1().use(): doc = Document(data=NoEscape(lorem)) doc.generate_pdf('config3_with_indent_again', clean_tex=False) doc = Document(data=NoEscape(lorem)) doc.generate_pdf('config4_without_indent_again', clean_tex=False)
def test(): assert type(cf.active) == cf.Default cf.active = cf.Version1() assert cf.active.indent assert Document()._indent cf.active = cf.Version1(indent=False) assert not cf.active.indent assert not Document()._indent with cf.Version1().use(): assert cf.active.indent assert Document()._indent assert not cf.active.indent assert not Document()._indent