Exemple #1
0
def normal():
    path_python_file = args.path_python_file
    path_html_dir = args.path_html_dir

    template = None
    if args.template:
        template = args.template

    layout = None
    if args.layout:
        layout = args.layout

    try:
        if args.directory:
            for root, dirs, files in os.walk(path_python_file):
                for name in files:
                    try:
                        if name[:-3] + ".html" in next(os.walk(path_html_dir))[2]:
                            continue
                    except Exception:
                        pass

                    python_path = os.path.join(root, name)
                    try:
                        docstrings_to_hTML = DocstringsToHTML(
                            python_path, path_python_file, path_html_dir, template, layout
                        )
                        docstrings_to_hTML.translate()
                    except FileNotPy:
                        continue
        else:
            python_dir = os.path.dirname(path_python_file)
            docstrings_to_hTML = DocstringsToHTML(path_python_file, python_dir, path_html_dir, template, layout)
            docstrings_to_hTML.translate()
    except Exception as e:
        sys.exit("Error: {0}".format(e))
Exemple #2
0
def test():
    lever = DocstringsToHTML.test()
    if not lever:
        print("Test is passed")
    else:
        print("Test fails")