Exemplo n.º 1
0
    def _process_all(self):
        # fallback test: only checks that no exception is raised
        def rec(p):
            return p.check(dotfile=0)

        for x in datadir.visit("*.rst2pdfconfig", rec=rec):
            process_configfile(x)
        for x in datadir.visit("*.txt", rec=rec):
            process_rest_file(x)
Exemplo n.º 2
0
    def _process_all(self):
        # fallback test: only checks that no exception is raised
        def rec(p):
            return p.check(dotfile=0)

        for x in data.visit("*.rst2pdfconfig", rec=rec):
            process_configfile(x)
        for x in data.visit("*.txt", rec=rec):
            process_rest_file(x)
Exemplo n.º 3
0
 def _process_configfile(self):
     config = datadir.join("example.rst2pdfconfig")
     pdf = config.new(ext="pdf")
     tex = datadir.join('example.tex')
     process_configfile(config, debug=True)
     assert pdf.check()
     assert tex.check()
     texcontent = tex.read()
     assert "Generated by" in texcontent
     assert "Docutils" in texcontent
     process_configfile(config, debug=False)
     assert pdf.check()
     assert not tex.check()
     pdf.remove()
Exemplo n.º 4
0
 def _process_configfile(self):
     config = datadir.join("example.rst2pdfconfig")
     pdf = config.new(ext="pdf")
     tex = datadir.join('example.tex')
     process_configfile(config, debug=True)
     assert pdf.check()
     assert tex.check()
     texcontent = tex.read()
     assert "Generated by" in texcontent
     assert "Docutils" in texcontent
     process_configfile(config, debug=False)
     assert pdf.check()
     assert not tex.check()
     pdf.remove()
Exemplo n.º 5
0
        directive.set_backend_and_register_directives("latex")
        
    for p in filenames:
        if not p.check():
            log("path %s not found, ignoring" % p)
            continue
        def fil(p):
            return p.check(fnmatch='*.txt', versioned=True)
        def rec(p):
            return p.check(dotfile=0)
        if p.check(dir=1):
            for x in p.visit(fil, rec):
                rest.process(x)
        elif p.check(file=1):
            if p.ext == ".rst2pdfconfig":
                directive.set_backend_and_register_directives("latex")
                process_configfile(p, options.debug)
            else:
                if options.topdf:
                    cfg = p.new(ext=".rst2pdfconfig")
                    if cfg.check():
                        print "using config file %s" % (cfg, )
                        process_configfile(cfg, options.debug)
                    else:
                        process_rest_file(p.localpath,
                                          options.stylesheet,
                                      options.debug)
                else:
                    rest.process(p)

Exemplo n.º 6
0
    for p in filenames:
        if not p.check():
            log("path %s not found, ignoring" % p)
            continue

        def fil(p):
            return p.check(fnmatch='*.txt', versioned=True)

        def rec(p):
            return p.check(dotfile=0)

        if p.check(dir=1):
            for x in p.visit(fil, rec):
                rest.process(x)
        elif p.check(file=1):
            if p.ext == ".rst2pdfconfig":
                directive.set_backend_and_register_directives("latex")
                process_configfile(p, options.debug)
            else:
                if options.topdf:
                    cfg = p.new(ext=".rst2pdfconfig")
                    if cfg.check():
                        print "using config file %s" % (cfg, )
                        process_configfile(cfg, options.debug)
                    else:
                        process_rest_file(p.localpath, options.stylesheet,
                                          options.debug)
                else:
                    rest.process(p)