Exemple #1
0
 def _process_rest_file(self):
     data = py.magic.autopath().dirpath().join("data")
     part2 = data.join("part1.txt")
     pdf = part2.new(ext="pdf")
     process_rest_file(part2)
     assert pdf.check()
     pdf.remove()
Exemple #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 datadir.visit("*.rst2pdfconfig", rec=rec):
            process_configfile(x)
        for x in datadir.visit("*.txt", rec=rec):
            process_rest_file(x)
Exemple #3
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)
Exemple #4
0
    def _graphviz_pdf(self):
        if not py.path.local.sysfind("dot") or not py.path.local.sysfind("latex"):
            py.test.skip("graphviz and latex needed")

        directive.set_backend_and_register_directives("latex")
        txt = py.path.local(datadir.join("graphviz.txt"))
        pdf = txt.new(ext="pdf")
        dotpdf = datadir.join("example1.pdf")
        process_rest_file(txt)
        assert pdf.check()
        assert dotpdf.check()
        pdf.remove()
        dotpdf.remove()
Exemple #5
0
    def _graphviz_pdf(self):
        for exe in 'dot latex epstopdf'.split():
            if  not py.path.local.sysfind(exe):
                py.test.skip("%r needed" %(exe,))

        directive.set_backend_and_register_directives("latex")
        txt = py.path.local(datadir.join("graphviz.txt"))
        pdf = txt.new(ext="pdf")
        dotpdf = datadir.join("example1.pdf")
        process_rest_file(txt)
        assert pdf.check()
        assert dotpdf.check()
        pdf.remove()
        dotpdf.remove()
Exemple #6
0
    def _graphviz_pdf(self):
        for exe in 'dot latex epstopdf ps2eps'.split():
            if not py.path.local.sysfind(exe):
                py.test.skip("%r needed" % (exe, ))

        directive.set_backend_and_register_directives("latex")
        txt = py.path.local(datadir.join("graphviz.txt"))
        pdf = txt.new(ext="pdf")
        dotpdf = datadir.join("example1.pdf")
        process_rest_file(txt)
        assert pdf.check()
        assert dotpdf.check()
        pdf.remove()
        dotpdf.remove()
Exemple #7
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)

Exemple #8
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)
Exemple #9
0
 def _process_rest_file(self):
     part2 = datadir.join("part1.txt")
     pdf = part2.new(ext="pdf")
     process_rest_file(part2)
     assert pdf.check()
     pdf.remove()
Exemple #10
0
 def _process_rest_file(self):
     part2 = datadir.join("part1.txt")
     pdf = part2.new(ext="pdf")
     process_rest_file(part2)
     assert pdf.check()
     pdf.remove()