def _print_run_info(item, output=False, scalars=False): for name in RUN_DETAIL: print("%s: %s" % (name, item.fmt.get(name, ""))) print("flags:", end="") print(run_util.format_attr(item.value.get("flags", ""))) if scalars: print("scalars:") for s in indexlib.iter_run_scalars(item.value): print(" %s: %f (step %i)" % (s["tag"], s["last_val"], s["last_step"])) if output: print("output:") for line in run_util.iter_output(item.value): print(" %s" % line, end="")
def _print_run_info(run, args): formatted = run_util.format_run(run) out = cli.out for name in RUN_DETAIL: out("%s: %s" % (name, formatted[name])) for name in other_attr_names(run, args.private_attrs): out("%s: %s" % (name, run_util.format_attr(run.get(name)))) out("flags:", nl=False) out(run_util.format_attr(run.get("flags", "")).rstrip()) _maybe_print_proto_flags(run, out) if args.env: out("environment:", nl=False) out(run_util.format_attr(run.get("env", ""))) if args.scalars: out("scalars:") for scalar in _iter_scalars(run): out(" %s" % scalar) if args.deps: out("dependencies:") deps = run.get("deps", {}) for name in sorted(deps): out(" %s:" % name) for path in deps[name]: out(" %s" % path) if args.sourcecode: out("sourcecode:") for path in sorted(run.iter_guild_files("sourcecode")): out(" %s" % path) if args.output: out("output:") for line in run_util.iter_output(run): out(" %s" % line, nl=False) if args.files or args.all_files: out("files:") for path in sorted(run.iter_files(args.all_files, args.follow_links)): if args.files == 1: path = os.path.relpath(path, run.path) out(" %s" % path)