Example #1
0
def main():
    p = optparse.OptionParser(__doc__)
    p.add_option("-c",
                 "--columns",
                 action="store",
                 type="int",
                 dest="cols",
                 default=3,
                 help="Maximum number of columns")
    options, args = p.parse_args()

    if len(args) != 0:
        p.error('Wrong number of arguments')

    # prepare
    fn = os.path.join(CUR_DIR, 'dump.xml')
    if os.path.isfile(fn):
        import_phantom_module(fn)

    # check
    documented, undocumented = check_numpy()

    # report
    in_sections = {}
    for name, locations in documented.items():
        for (filename, section, keyword, toctree) in locations:
            in_sections.setdefault((filename, section, keyword),
                                   []).append(name)

    print("Documented")
    print("==========\n")

    last_filename = None
    for (filename, section, keyword), names in sorted(in_sections.items()):
        if filename != last_filename:
            print("--- %s\n" % filename)
        last_filename = filename
        print(" ** ", section)
        print(format_in_columns(sorted(names), options.cols))
        print("\n")

    print("")
    print("Undocumented")
    print("============\n")
    print(format_in_columns(sorted(undocumented.keys()), options.cols))
Example #2
0
def main():
    import argparse

    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument(
        "-c",
        "--columns",
        type=int,
        default=3,
        help="Maximum number of columns (default: %(default)d)")
    args = parser.parse_args()

    # prepare
    fn = os.path.join(CUR_DIR, 'dump.xml')
    if os.path.isfile(fn):
        import_phantom_module(fn)

    # check
    documented, undocumented = check_numpy()

    # report
    in_sections = {}
    for name, locations in documented.items():
        for (filename, section, keyword, toctree) in locations:
            in_sections.setdefault((filename, section, keyword),
                                   []).append(name)

    print("Documented")
    print("==========\n")

    last_filename = None
    for (filename, section, keyword), names in sorted(in_sections.items()):
        if filename != last_filename:
            print("--- %s\n" % filename)
        last_filename = filename
        print(" ** ", section)
        print(format_in_columns(sorted(names), args.columns))
        print("\n")

    print("")
    print("Undocumented")
    print("============\n")
    print(format_in_columns(sorted(undocumented.keys()), args.columns))
Example #3
0
def main():
    p = optparse.OptionParser(__doc__)
    p.add_option("-c", "--columns", action="store", type="int", dest="cols",
                 default=3, help="Maximum number of columns")
    options, args = p.parse_args()

    if len(args) != 0:
        p.error('Wrong number of arguments')

    # prepare
    fn = os.path.join(CUR_DIR, 'dump.xml')
    if os.path.isfile(fn):
        import_phantom_module(fn)

    # check
    documented, undocumented = check_numpy()

    # report
    in_sections = {}
    for name, locations in documented.iteritems():
        for (filename, section, keyword, toctree) in locations:
            in_sections.setdefault((filename, section, keyword), []).append(name)

    print "Documented"
    print "==========\n"

    last_filename = None
    for (filename, section, keyword), names in sorted(in_sections.items()):
        if filename != last_filename:
            print "--- %s\n" % filename
        last_filename = filename
        print " ** ", section
        print format_in_columns(sorted(names), options.cols)
        print "\n"

    print ""
    print "Undocumented"
    print "============\n"
    print format_in_columns(sorted(undocumented.keys()), options.cols)