[pypy-svn] r38826 - in pypy/dist/pypy/doc: . config

cfbolz at codespeak.net cfbolz at codespeak.net
Wed Feb 14 14:37:48 CET 2007


Author: cfbolz
Date: Wed Feb 14 14:37:46 2007
New Revision: 38826

Modified:
   pypy/dist/pypy/doc/config/confrest.py
   pypy/dist/pypy/doc/config/objspace.lowmem.txt
   pypy/dist/pypy/doc/config/translation.gc.txt
   pypy/dist/pypy/doc/conftest.py
Log:
 - document two more options
 - change conftest to register a :config:`...` link role that will produce a
   link to a configuration description page


Modified: pypy/dist/pypy/doc/config/confrest.py
==============================================================================
--- pypy/dist/pypy/doc/config/confrest.py	(original)
+++ pypy/dist/pypy/doc/config/confrest.py	Wed Feb 14 14:37:46 2007
@@ -42,6 +42,7 @@
                     fullpath.split(".", 1)[1])
             descr = getattr(subconf._cfgimpl_descr, step)
         text = unicode(descr.make_rest_doc(path).text())
+        text += "\nDescription\n==========="
         if txtpath.check(file=True):
             return u"%s\n\n%s" % (text, unicode(txtpath.read(), encoding))
         return text

Modified: pypy/dist/pypy/doc/config/objspace.lowmem.txt
==============================================================================
--- pypy/dist/pypy/doc/config/objspace.lowmem.txt	(original)
+++ pypy/dist/pypy/doc/config/objspace.lowmem.txt	Wed Feb 14 14:37:46 2007
@@ -0,0 +1,4 @@
+Try to use as little memory as possible *during translation*. Currently only
+disables geninterp_ which also makes the resulting binary slower.
+
+.. _geninterp: objspace.geninterp.html

Modified: pypy/dist/pypy/doc/config/translation.gc.txt
==============================================================================
--- pypy/dist/pypy/doc/config/translation.gc.txt	(original)
+++ pypy/dist/pypy/doc/config/translation.gc.txt	Wed Feb 14 14:37:46 2007
@@ -0,0 +1,15 @@
+Choose the Garbage Collector used by the translated program:
+
+  - "ref": reference counting. Takes very long to translate and the result is
+    slow.
+
+  - "framework": our custom mark-and-sweep collector. Takes moderately long and
+    is the fastest option without external dependencies.
+
+  - "stacklessgc": same as "framework" but uses a different method to find the
+    garbage collection roots on the stack, by unwinding it, using stackless:
+    :config:`translation.stackless`.
+
+  - "boehm": use the Boehm conservative GC
+
+

Modified: pypy/dist/pypy/doc/conftest.py
==============================================================================
--- pypy/dist/pypy/doc/conftest.py	(original)
+++ pypy/dist/pypy/doc/conftest.py	Wed Feb 14 14:37:46 2007
@@ -1,5 +1,8 @@
 import py
 from py.__.doc.conftest import Directory, DoctestText, ReSTChecker
+from py.__.rest.directive import register_linkrole
+
+thisdir = py.magic.autopath().dirpath()
 
 Option = py.test.config.Option
 option = py.test.config.addoptions("pypy-doc options", 
@@ -41,3 +44,33 @@
     
 class Directory(Directory): 
     ReSTChecker = PyPyReSTChecker 
+
+try:
+    from docutils.parsers.rst import directives, states, roles
+except ImportError:
+    pass
+else:
+    # enable :config: link role
+    def config_role(name, rawtext, text, lineno, inliner, options={},
+                    content=[]):
+        from docutils import nodes
+        txt = thisdir.join("config", text + ".txt")
+        html = thisdir.join("config", text + ".html")
+        assert txt.check()
+        assert name == "config"
+        sourcedir = py.path.local(inliner.document.settings._source).dirpath()
+        curr = sourcedir
+        prefix = ""
+        while 1:
+            relative = str(html.relto(curr))
+            if relative:
+                break
+            curr = curr.dirpath()
+            prefix += "../"
+        target = prefix + relative
+        print text, target
+        reference_node = nodes.reference(rawtext, text, name=text, refuri=target)
+        return [reference_node], []
+    config_role.content = True
+    config_role.options = {}
+    roles.register_canonical_role("config", config_role)



More information about the Pypy-commit mailing list