move and rename html rest helper to rest directory - finally remove py/misc completely

--HG--
branch : trunk
This commit is contained in:
holger krekel 2009-08-25 16:15:17 +02:00
parent e810e1774d
commit 94aef0b771
9 changed files with 11 additions and 15 deletions

View File

@ -1,5 +1,5 @@
import py import py
from py.__.misc.rest import convert_rest_html, strip_html_header from py.__.rest.resthtml import convert_rest_html, strip_html_header
html = py.xml.html html = py.xml.html

View File

@ -36,8 +36,7 @@ parser.add_option("--debug", action="store_true", dest="debug",
def main(): def main():
try: try:
from py.__.misc import rest from py.__.rest import directive, resthtml
from py.__.rest import directive
from py.__.rest.latex import process_rest_file, process_configfile from py.__.rest.latex import process_rest_file, process_configfile
except ImportError, e: except ImportError, e:
print str(e) print str(e)
@ -63,7 +62,7 @@ def main():
return p.check(dotfile=0) return p.check(dotfile=0)
if p.check(dir=1): if p.check(dir=1):
for x in p.visit(fil, rec): for x in p.visit(fil, rec):
rest.process(x) resthtml.process(x)
elif p.check(file=1): elif p.check(file=1):
if p.ext == ".rst2pdfconfig": if p.ext == ".rst2pdfconfig":
directive.set_backend_and_register_directives("latex") directive.set_backend_and_register_directives("latex")
@ -79,5 +78,5 @@ def main():
options.stylesheet, options.stylesheet,
options.debug) options.debug)
else: else:
rest.process(p) resthtml.process(p)

View File

@ -1 +0,0 @@
#

View File

@ -1 +0,0 @@
#

View File

@ -2,8 +2,7 @@ import py
from py.__.rest.testing.setup import getdata from py.__.rest.testing.setup import getdata
docutils = py.test.importorskip("docutils") docutils = py.test.importorskip("docutils")
from py.__.rest import directive from py.__.rest import directive, resthtml
from py.__.misc import rest
from py.__.rest.latex import process_rest_file from py.__.rest.latex import process_rest_file
def setup_module(mod): def setup_module(mod):
@ -20,7 +19,7 @@ class TestGraphviz(object):
txt = datadir.join("graphviz.txt") txt = datadir.join("graphviz.txt")
html = txt.new(ext="html") html = txt.new(ext="html")
png = datadir.join("example1.png") png = datadir.join("example1.png")
rest.process(txt) resthtml.process(txt)
assert html.check() assert html.check()
assert png.check() assert png.check()
html_content = html.read() html_content = html.read()
@ -57,7 +56,7 @@ def test_own_links():
:foo:`whatever` :foo:`whatever`
""") """)
html = txt.new(ext="html") html = txt.new(ext="html")
rest.process(txt) resthtml.process(txt)
assert html.check() assert html.check()
htmlcontent = html.read() htmlcontent = html.read()
assert "http://codespeak.net/noclue" in htmlcontent assert "http://codespeak.net/noclue" in htmlcontent

View File

@ -1,7 +1,7 @@
from __future__ import generators from __future__ import generators
import py import py
from py.__.misc import rest from py.__.rest import resthtml
from py.__.rest.testing.setup import getdata from py.__.rest.testing.setup import getdata
@ -18,5 +18,5 @@ def test_process_simple():
def rec(p): def rec(p):
return p.check(dotfile=0) return p.check(dotfile=0)
for x in datadir.visit("*.txt", rec=rec): for x in datadir.visit("*.txt", rec=rec):
yield rest.process, x yield resthtml.process, x

View File

@ -4,7 +4,7 @@
import py import py
py.test.importorskip("docutils") py.test.importorskip("docutils")
from py.__.rest.rst import * from py.__.rest.rst import *
from py.__.misc.rest import process as restcheck from py.__.rest.resthtml import process as restcheck
import traceback import traceback
tempdir = py.test.ensuretemp('rest') tempdir = py.test.ensuretemp('rest')

View File

@ -397,7 +397,7 @@ class TestDoctest:
def pytest_funcarg__testdir(self, request): def pytest_funcarg__testdir(self, request):
testdir = request.getfuncargvalue("testdir") testdir = request.getfuncargvalue("testdir")
assert request.module.__name__ == __name__ assert request.module.__name__ == __name__
testdir.makepyfile(confrest="from py.__.misc.rest import Project") testdir.makepyfile(confrest="from py.__.rest.resthtml import Project")
for p in testdir.plugins: for p in testdir.plugins:
if p == globals(): if p == globals():
break break