Ejemplo n.º 1
0
def main():
    args = parse_args()
    broker = dr.Broker()
    packages = parse_plugins(args.plugins)
    with Client(packages=packages) as client:
        doc = client.process(args.archive, broker=broker)
        print(doc["results"].decode("utf-8"))
Ejemplo n.º 2
0
def main():
    args = parse_args()

    plugins = parse_plugins(args.plugins)
    for p in plugins:
        dr.load_components(p, continue_on_error=False)

    results = defaultdict(list)
    for comp, delegate in dr.DELEGATES.items():
        if isinstance(delegate, rule):
            results[dr.get_base_module_name(comp)].append(comp)

    results = dict(
        (key, comps) for key, comps in results.items() if len(comps) > 1)

    if results:
        print("Potential key conflicts:")
        print()
        for key in sorted(results):
            print("{key}:".format(key=key))
            for comp in sorted(results[key], key=dr.get_name):
                name = comp.__name__
                path = inspect.getabsfile(comp)
                print("    {name} in {path}".format(name=name, path=path))
            print()
Ejemplo n.º 3
0
def main():
    args = _parse_args()
    logging.basicConfig(level=logging.DEBUG if args.verbose else logging.ERROR)

    cov = None
    if not args.no_coverage:
        from coverage import Coverage

        cov = Coverage(cover_pylib=False)
        cov.start()

    if not args.no_defaults:
        load_default_plugins()
        dr.load_components("insights.parsers", "insights.combiners")

    load_packages(parse_plugins(args.plugins))
    _handle_config(args.config)

    start_session(args.paths, args.cd, __coverage=cov, kernel=args.kernel)
    if cov:
        cov.stop()
        cov.erase()