Ejemplo n.º 1
0
def get_pages_from_planner():
    p = subprocess.Popen(["../../src/search/downward-1", "--help", "--txt2tags"], stdout=subprocess.PIPE)
    out = p.communicate()[0]
    #split the output into tuples (title, markup_text)
    pagesplitter = re.compile(r'>>>>CATEGORY: ([\w\s]+?)<<<<(.+?)>>>>CATEGORYEND<<<<', re.DOTALL)
    pages = dict()
    for title, markup_text in pagesplitter.findall(out):
        document = markup.Document(date='')
        document.add_text("<<TableOfContents>>")
        document.add_text(markup_text)
        rendered_text = document.render("moin").strip()
        pages[DOC_PREFIX + title] = rendered_text
    return pages
Ejemplo n.º 2
0
def get_pages_from_planner():
    planner = os.path.join(REPO_ROOT_DIR, "builds", "release32", "bin", "downward")
    out = subprocess.check_output([planner, "--help", "--txt2tags"])
    #split the output into tuples (title, markup_text)
    pagesplitter = re.compile(r'>>>>CATEGORY: ([\w\s]+?)<<<<(.+?)>>>>CATEGORYEND<<<<', re.DOTALL)
    pages = dict()
    for title, markup_text in pagesplitter.findall(out):
        document = markup.Document(date='')
        document.add_text("<<TableOfContents>>")
        document.add_text(markup_text)
        rendered_text = document.render("moin").strip()
        pages[DOC_PREFIX + title] = rendered_text
    return pages
Ejemplo n.º 3
0
def get_pages_from_planner(build):
    out = subprocess.check_output([
        "./fast-downward.py", "--build", build, "--search", "--", "--help",
        "--txt2tags"
    ],
                                  cwd=REPO_ROOT_DIR)
    #split the output into tuples (title, markup_text)
    pagesplitter = re.compile(
        r'>>>>CATEGORY: ([\w\s]+?)<<<<(.+?)>>>>CATEGORYEND<<<<', re.DOTALL)
    pages = dict()
    for title, markup_text in pagesplitter.findall(out):
        document = markup.Document(date='')
        document.add_text("<<TableOfContents>>")
        document.add_text(markup_text)
        rendered_text = document.render("moin").strip()
        pages[DOC_PREFIX + title] = rendered_text
    return pages