Пример #1
0
def get_all_components():

    comps = {}

    # If RMF is being built as part of IMP, split out its build (rather than
    # building it as part of IMP.rmf)
    special_dep_targets = {"RMF": RMFDependency}
    for dep, cls in special_dep_targets.items():
        i = tools.get_dependency_info(dep, "")
        if i['ok'] and internal_dep(dep):
            comps[dep] = cls(dep)
            comps[dep].set_dep_modules(comps, [], [], special_dep_targets)

    modules = tools.get_sorted_order()
    apps = tools.get_all_configured_applications()
    for m in modules:
        comps[m] = Module(m)
    for a in apps:
        comps[a] = Application(a)

    for m in modules:
        i = tools.get_module_info(m, "")
        comps[m].set_dep_modules(comps, i['modules'], i['dependencies'],
                                 special_dep_targets)
    for a in apps:
        i = tools.get_application_info(a, "")
        comps[a].set_dep_modules(comps, i['modules'], i['dependencies'],
                                 special_dep_targets)
    source_dir = os.path.join(os.path.dirname(sys.argv[0]), '..', '..')
    all_modules= [x[0] for x in tools.get_modules(source_dir)]
    all_apps= [x[0] for x in tools.get_applications(source_dir)]
    add_disabled_components(modules, all_modules, comps, "module")
    add_disabled_components(apps, all_apps, comps, "application")
    return comps
Пример #2
0
def parse_args():
    parser = OptionParser(usage="""%prog [options] outdir

Generate HTML coverage reports for IMP C++/Python code in the given directory.
""")
    parser.add_option("--report",
                      type="choice",
                      choices=['python', 'cpp', 'both'],
                      default='both',
                      help="Generate reports for Python code ('python'), "
                      "C++ code ('cpp') or both Python and C++ ('both'). "
                      "Default 'both'.")
    parser.add_option("--modules",
                      metavar='STR',
                      default=None,
                      help="Report only for the given colon-separated list of "
                      "IMP modules, e.g. 'base:kernel'. By default, "
                      "coverage for all modules is reported.")
    parser.add_option("--applications",
                      metavar='STR',
                      default=None,
                      help="Report only for the given colon-separated list of "
                      "IMP applications, e.g. 'foxs:saxs_merge'. By "
                      "default, coverage for all applications is "
                      "reported.")
    parser.add_option("--dependencies",
                      metavar='STR',
                      default=None,
                      help="Report only for the given colon-separated list of "
                      "IMP dependencies, e.g. 'RMF'. By default, coverage "
                      "for all supported dependencies (currently only "
                      "RMF) is reported.")
    parser.add_option("--exclude",
                      metavar='PCK',
                      default=None,
                      help="Don't report coverage for any of the components "
                      "listed in the given summary file (as generated by "
                      "build_all.py).")
    opts, args = parser.parse_args()
    if len(args) != 1:
        parser.error("wrong number of arguments")
    if opts.exclude:
        exclude = pickle.load(open(opts.exclude))
    else:
        exclude = {}
    opts.modules = _get_components(opts.modules, tools.get_sorted_order(),
                                   exclude)
    opts.applications = _get_components(
        opts.applications, tools.get_all_configured_applications(), exclude)
    opts.dependencies = _get_components(opts.dependencies, ['RMF'], exclude)
    return opts, args[0]
Пример #3
0
def parse_args():
    parser = OptionParser(usage="""%prog [options] outdir

Generate HTML coverage reports for IMP C++/Python code in the given directory.
""")
    parser.add_option("--report", type="choice",
                      choices=['python', 'cpp', 'both'], default='both',
                      help="Generate reports for Python code ('python'), "
                           "C++ code ('cpp') or both Python and C++ ('both'). "
                           "Default 'both'.")
    parser.add_option("--modules", metavar='STR', default=None,
                      help="Report only for the given colon-separated list of "
                           "IMP modules, e.g. 'base:kernel'. By default, "
                           "coverage for all modules is reported.")
    parser.add_option("--applications", metavar='STR', default=None,
                      help="Report only for the given colon-separated list of "
                           "IMP applications, e.g. 'foxs:saxs_merge'. By "
                           "default, coverage for all applications is "
                           "reported.")
    parser.add_option("--dependencies", metavar='STR', default=None,
                      help="Report only for the given colon-separated list of "
                           "IMP dependencies, e.g. 'RMF'. By default, coverage "
                           "for all supported dependencies (currently only "
                           "RMF) is reported.")
    parser.add_option("--exclude", metavar='PCK', default=None,
                      help="Don't report coverage for any of the components "
                           "listed in the given summary file (as generated by "
                           "build_all.py).")
    opts, args = parser.parse_args()
    if len(args) != 1:
        parser.error("wrong number of arguments")
    if opts.exclude:
        exclude = pickle.load(open(opts.exclude))
    else:
        exclude = {}
    opts.modules = _get_components(opts.modules, tools.get_sorted_order(),
                                   exclude)
    opts.applications = _get_components(opts.applications,
                                        tools.get_all_configured_applications(),
                                        exclude)
    opts.dependencies = _get_components(opts.dependencies, ['RMF'], exclude)
    return opts, args[0]