pypy / pypy / doc / config /

import autopath
import py
from pypy.config import pypyoption, translationoption, config, makerestdoc
from pypy.doc.config.confrest import all_optiondescrs

all_optiondescrs = [pypyoption.pypy_optiondescription,
start_to_descr = dict([(descr._name, descr) for descr in all_optiondescrs])

def make_cmdline_overview():
    result = []
    txtpath = thisdir.join("commandline.txt")
    for line in
        if line.startswith('.. GENERATE:'):
            start = line[len('.. GENERATE:'):].strip()
            descr = start_to_descr[start]
            line = makerestdoc.make_cmdline_overview(descr, title=False).text()
    rstpath =".rst")

def make_rst(basename):
    txtpath = thisdir.join(basename)
    rstpath =".rst")

    fullpath = txtpath.purebasename
    start = fullpath.split(".")[0]
    path = fullpath.rsplit(".", 1)[0]
    basedescr = start_to_descr.get(start)
    if basedescr is None:
    if fullpath.count(".") == 0:
        descr = basedescr
        path = ""
        conf = config.Config(basedescr)
        subconf, step = conf._cfgimpl_get_home_by_path(
                fullpath.split(".", 1)[1])
        descr = getattr(subconf._cfgimpl_descr, step)
    text = unicode(descr.make_rest_doc(path).text())
    if txtpath.check(file=True):
        content =
        if content:
            text += "\n\n"
            text = u"%s\n\n%s" % (text, unicode(, "utf-8"))

thisdir = py.path.local(__file__).dirpath()

for descr in all_optiondescrs:
    prefix = descr._name
    c = config.Config(descr)
    thisdir.join(prefix + ".txt").ensure()
    make_rst(prefix + ".txt")
    for p in c.getpaths(include_groups=True):
        basename = prefix + "." + p + ".txt"

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.