コード例 #1
0
ファイル: test_rst2pdf.py プロジェクト: TheDunn/flex-pypy
 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()
コード例 #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)
コード例 #3
0
ファイル: test_rst2pdf.py プロジェクト: TheDunn/flex-pypy
    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)
コード例 #4
0
ファイル: test_directive.py プロジェクト: TheDunn/flex-pypy
    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()
コード例 #5
0
ファイル: test_directive.py プロジェクト: paskma/py
    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()
コード例 #6
0
ファイル: test_directive.py プロジェクト: neurobcn/plexnet
    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()
コード例 #7
0
ファイル: pyrest.py プロジェクト: enyst/plexnet
        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)

コード例 #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)
コード例 #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()
コード例 #10
0
ファイル: test_rst2pdf.py プロジェクト: paskma/py
 def _process_rest_file(self):
     part2 = datadir.join("part1.txt")
     pdf = part2.new(ext="pdf")
     process_rest_file(part2)
     assert pdf.check()
     pdf.remove()