Exemplo n.º 1
0
def _publish_runs(runs, formatted, args):
    if args.all_files:
        copy_files = publishlib.COPY_ALL_FILES
    elif args.files or args.include_links:
        copy_files = publishlib.COPY_DEFAULT_FILES
    else:
        copy_files = None
    for run, frun in zip(runs, formatted):
        cli.out("Publishing [%s] %s... " %
                (frun["short_id"], frun["operation"]),
                nl=False)
        frun["_run"] = run
        try:
            publishlib.publish_run(run,
                                   dest=args.dest,
                                   template=args.template,
                                   copy_files=copy_files,
                                   include_links=args.include_links,
                                   md5s=not args.no_md5,
                                   formatted_run=frun)
        except publishlib.PublishError as e:
            cli.error("error publishing run %s:\n%s" % (run.id, e))
        else:
            dest = args.dest or publishlib.DEFAULT_DEST_HOME
            size = util.dir_size(os.path.join(dest, run.id))
            cli.out("using %s" % util.format_bytes(size))
Exemplo n.º 2
0
def _report_dir_size(args):
    dest = args.dest or publishlib.DEFAULT_DEST_HOME
    size = util.dir_size(dest)
    cli.out("Published runs using %s" % util.format_bytes(size))