From 94aef0b7711b1b6c0e1e319693eef2c24d33aaa7 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 25 Aug 2009 16:15:17 +0200 Subject: [PATCH] move and rename html rest helper to rest directory - finally remove py/misc completely --HG-- branch : trunk --- doc/confrest.py | 2 +- py/cmdline/pyrest.py | 7 +++---- py/misc/__init__.py | 1 - py/misc/testing/__init__.py | 1 - py/{misc/rest.py => rest/resthtml.py} | 0 py/rest/testing/test_directive.py | 7 +++---- py/rest/testing/test_htmlrest.py | 4 ++-- py/rest/testing/test_rst.py | 2 +- py/test/plugin/pytest_restdoc.py | 2 +- 9 files changed, 11 insertions(+), 15 deletions(-) delete mode 100644 py/misc/__init__.py delete mode 100644 py/misc/testing/__init__.py rename py/{misc/rest.py => rest/resthtml.py} (100%) diff --git a/doc/confrest.py b/doc/confrest.py index 74a43b3e1..e6af6fde8 100644 --- a/doc/confrest.py +++ b/doc/confrest.py @@ -1,5 +1,5 @@ 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 diff --git a/py/cmdline/pyrest.py b/py/cmdline/pyrest.py index 1032dc653..40a12d819 100755 --- a/py/cmdline/pyrest.py +++ b/py/cmdline/pyrest.py @@ -36,8 +36,7 @@ parser.add_option("--debug", action="store_true", dest="debug", def main(): try: - from py.__.misc import rest - from py.__.rest import directive + from py.__.rest import directive, resthtml from py.__.rest.latex import process_rest_file, process_configfile except ImportError, e: print str(e) @@ -63,7 +62,7 @@ def main(): return p.check(dotfile=0) if p.check(dir=1): for x in p.visit(fil, rec): - rest.process(x) + resthtml.process(x) elif p.check(file=1): if p.ext == ".rst2pdfconfig": directive.set_backend_and_register_directives("latex") @@ -79,5 +78,5 @@ def main(): options.stylesheet, options.debug) else: - rest.process(p) + resthtml.process(p) diff --git a/py/misc/__init__.py b/py/misc/__init__.py deleted file mode 100644 index 792d60054..000000000 --- a/py/misc/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# diff --git a/py/misc/testing/__init__.py b/py/misc/testing/__init__.py deleted file mode 100644 index 792d60054..000000000 --- a/py/misc/testing/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# diff --git a/py/misc/rest.py b/py/rest/resthtml.py similarity index 100% rename from py/misc/rest.py rename to py/rest/resthtml.py diff --git a/py/rest/testing/test_directive.py b/py/rest/testing/test_directive.py index 570abc8ca..5e95de7a6 100644 --- a/py/rest/testing/test_directive.py +++ b/py/rest/testing/test_directive.py @@ -2,8 +2,7 @@ import py from py.__.rest.testing.setup import getdata docutils = py.test.importorskip("docutils") -from py.__.rest import directive -from py.__.misc import rest +from py.__.rest import directive, resthtml from py.__.rest.latex import process_rest_file def setup_module(mod): @@ -20,7 +19,7 @@ class TestGraphviz(object): txt = datadir.join("graphviz.txt") html = txt.new(ext="html") png = datadir.join("example1.png") - rest.process(txt) + resthtml.process(txt) assert html.check() assert png.check() html_content = html.read() @@ -57,7 +56,7 @@ def test_own_links(): :foo:`whatever` """) html = txt.new(ext="html") - rest.process(txt) + resthtml.process(txt) assert html.check() htmlcontent = html.read() assert "http://codespeak.net/noclue" in htmlcontent diff --git a/py/rest/testing/test_htmlrest.py b/py/rest/testing/test_htmlrest.py index c3e3ada46..cf78edc38 100644 --- a/py/rest/testing/test_htmlrest.py +++ b/py/rest/testing/test_htmlrest.py @@ -1,7 +1,7 @@ from __future__ import generators import py -from py.__.misc import rest +from py.__.rest import resthtml from py.__.rest.testing.setup import getdata @@ -18,5 +18,5 @@ def test_process_simple(): def rec(p): return p.check(dotfile=0) for x in datadir.visit("*.txt", rec=rec): - yield rest.process, x + yield resthtml.process, x diff --git a/py/rest/testing/test_rst.py b/py/rest/testing/test_rst.py index 7f03f502f..4cb6c27b0 100644 --- a/py/rest/testing/test_rst.py +++ b/py/rest/testing/test_rst.py @@ -4,7 +4,7 @@ import py py.test.importorskip("docutils") from py.__.rest.rst import * -from py.__.misc.rest import process as restcheck +from py.__.rest.resthtml import process as restcheck import traceback tempdir = py.test.ensuretemp('rest') diff --git a/py/test/plugin/pytest_restdoc.py b/py/test/plugin/pytest_restdoc.py index 95928be10..a0d05c57e 100644 --- a/py/test/plugin/pytest_restdoc.py +++ b/py/test/plugin/pytest_restdoc.py @@ -397,7 +397,7 @@ class TestDoctest: def pytest_funcarg__testdir(self, request): testdir = request.getfuncargvalue("testdir") 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: if p == globals(): break