Пример #1
0
                item = '\n\nRequire: ' + require + item
            alllines = []
            s = " ######\n"
            for line in item.splitlines():
                name_line = re.findall(r"([\s*]?Name[\s*]?\:)(.*)", line)
                if name_line:
                    # Clean the Name: line
                    name_line_0 = name_line[0][0].strip()
                    name_line_1 = name_line[0][1].strip()
                    line = name_line_0 + ' ' + name_line_1
                line = textwrap.dedent(line).strip()
                # Tricks for the blanks
                line = html.escape(line)
                line = re.sub(r'^(\s)*- ', ' • ', line)
                line = re.sub(r'^(\s)*@note', ' • ', line)
                alllines.append(line)
            item = '\n'.join(alllines)
            num += 1
            documentation = {}
            split_items = re.split("(^|\n)(" + "|".join(keywords) + ")", item)
            keyword_curr = ""
            for i, token in enumerate(split_items):
                if token in keywords:
                    keyword_curr = token
                    documentation[keyword_curr] = ""
                else:
                    if keyword_curr in documentation:
                        documentation[keyword_curr] += " " + token
            all_data = coll_data(keywords, documentation, num, helpdir, fname,
                                 sli_command_list)
Пример #2
0
                if name_line:
                    # Clean the Name: line!
                    name_line_0 = name_line[0][0].strip()
                    name_line_1 = name_line[0][1].strip()
                    line = name_line_0 + ' ' + name_line_1
                line = textwrap.dedent(line).strip()
                # Tricks for the blanks
                line = re.sub(r"(\s){5,}", '~~~ ', line)
                line = re.sub(r"(\s){3,4}", '~~ ', line)
                line = re.sub(r"(\s){2}", '~ ', line)
                alllines.append(line)
            item = s.join(alllines)
            num += 1
            documentation = {}
            keyword_curr = ""
            for token in item.split():
                if token in keywords:
                    keyword_curr = token
                    documentation[keyword_curr] = ""
                else:
                    if keyword_curr in documentation:
                        documentation[keyword_curr] += " " + token

            all_data = coll_data(keywords, documentation, num, helpdir, fname,
                                 sli_command_list)

write_helpindex(helpdir)

shutil.rmtree(install_dir, ignore_errors=True)
shutil.copytree(helpdir, install_dir)