コード例 #1
0
def main():
    try:
        args, kythe_args, options = parse_args.parse_args(sys.argv[1:])
    except utils.UsageError as e:
        print(str(e), file=sys.stderr)
        sys.exit(1)

    if options.timeout is not None:
        signal.alarm(options.timeout)

    try:
        ix = indexer.process_file(options, generate_callgraphs=True)
    except indexer.PytypeError as e:
        print(e.args[0], file=sys.stderr)
        if args.debug:
            traceback.print_exc()
        else:
            print("Run with --debug to see a traceback.")
        sys.exit(1)

    if args.debug:
        debug.show_index(ix)
    else:
        kythe_graph = kythe.generate_graph(ix, kythe_args)
        output.output_kythe_graph(kythe_graph)
コード例 #2
0
ファイル: main.py プロジェクト: ukulili/pytype
def main():
    try:
        args, kythe_args, options = parse_args.parse_args(sys.argv[1:])
    except utils.UsageError as e:
        print(str(e), file=sys.stderr)
        sys.exit(1)

    node.SetCheckPreconditions(options.check_preconditions)

    if options.timeout is not None:
        signal.alarm(options.timeout)

    try:
        ix, _ = indexer.process_file(options,
                                     kythe_args=kythe_args,
                                     keep_pytype_data=args.debug)
    except indexer.PytypeError as e:
        print(e.args[0], file=sys.stderr)
        if args.debug:
            traceback.print_exc()
        else:
            print("Run with --debug to see a traceback.")
        sys.exit(1)

    if args.debug:
        debug.show_index(ix, keep_pytype_data=True)
    else:
        output.output_kythe_graph(ix)
コード例 #3
0
ファイル: main.py プロジェクト: stevenmburns/pytype
def main():
    try:
        args, kythe_args, options = parse_args.parse_args(sys.argv[1:])
    except utils.UsageError as e:
        print(str(e), file=sys.stderr)
        sys.exit(1)

    node.SetCheckPreconditions(options.check_preconditions)

    if options.timeout is not None:
        signal.alarm(options.timeout)

    ix = indexer.process_file(options, kythe_args=kythe_args)
    if args.debug:
        debug.show_index(ix)
    else:
        output.output_kythe_graph(ix)