def make_cmdline_overview(descr, title=True): content = Rest() if title: content.add(Title("Overview of Command Line Options for '%s'" % (descr._name,), abovechar="=", belowchar="=")) cmdlines = [] config = Config(descr) for path in config.getpaths(include_groups=False): subconf, step = config._cfgimpl_get_home_by_path(path) fullpath = descr._name + "." + path prefix = fullpath.rsplit(".", 1)[0] subdescr = getattr(subconf._cfgimpl_descr, step) cmdline = get_cmdline(subdescr.cmdline, fullpath) if cmdline is not None: header = _get_section_header(cmdline, fullpath, subdescr) cmdlines.append((header, cmdline, fullpath, subdescr)) cmdlines.sort(key=lambda x: (x[0], x[1].strip("-"))) currheader = "" curr = content for header, cmdline, fullpath, subdescr in cmdlines: if header != currheader: content.add(Title(header, abovechar="", belowchar="=")) curr = content.add(Paragraph()) currheader = header curr.add(ListItem(Link(cmdline + ":", fullpath + ".html"), Text(subdescr.doc))) return content
def make_cmdline_overview(descr, title=True): content = Rest() if title: content.add( Title("Overview of Command Line Options for '%s'" % (descr._name, ), abovechar="=", belowchar="=")) cmdlines = [] config = Config(descr) for path in config.getpaths(include_groups=False): subconf, step = config._cfgimpl_get_home_by_path(path) fullpath = (descr._name + "." + path) prefix = fullpath.rsplit(".", 1)[0] subdescr = getattr(subconf._cfgimpl_descr, step) cmdline = get_cmdline(subdescr.cmdline, fullpath) if cmdline is not None: header = _get_section_header(cmdline, fullpath, subdescr) cmdlines.append((header, cmdline, fullpath, subdescr)) cmdlines.sort(key=lambda x: (x[0], x[1].strip("-"))) currheader = "" curr = content for header, cmdline, fullpath, subdescr in cmdlines: if header != currheader: content.add(Title(header, abovechar="", belowchar="=")) curr = content.add(Paragraph()) currheader = header curr.add( ListItem(Link(cmdline + ":", fullpath + ".html"), Text(subdescr.doc))) return content
def test_check_documentation(): from pypy.doc.config.confrest import all_optiondescrs configdocdir = thisdir.dirpath().dirpath().join("doc", "config") for descr in all_optiondescrs: prefix = descr._name c = Config(descr) for path in c.getpaths(include_groups=True): fn = prefix + "." + path + ".txt" assert configdocdir.join(fn).check()
def test_check_documentation(): def check_file_exists(fn): assert configdocdir.join(fn).check() from pypy.doc.config.confrest import all_optiondescrs configdocdir = thisdir.dirpath().dirpath().join("doc", "config") for descr in all_optiondescrs: prefix = descr._name c = Config(descr) for path in c.getpaths(include_groups=True): fn = prefix + "." + path + ".txt" yield check_file_exists, fn