def backup(compress, encrypt, cert, storage_class, jobname, progress, color, dry_run, folder, bucket):
    check_dependencies(compress, encrypt)
    yellow = color_macro(color, colored.yellow)
    pv_support = supports_pv()
    if not pv_support:
        puts(f"{yellow('Warning')}: progress enabled, but pv not found in PATH. Falling back to no-progress")
    do_backup(compress, encrypt, cert, storage_class, jobname, progress and pv_support, color, dry_run, folder, bucket)
    pass
Example #2
0
def main(options):
    utils.check_dependencies(BIN, REQUIRED)
    tracks = [Track(path) for path in options.paths]

    cddb, id1, id2 = get_disc_ids(tracks, options.additional_sectors, options.data_track_len, options.verbose)
    print("Disc ID: %08x-%08x-%08x" % (id1, id2, cddb))
    get_ar_entries(cddb, id1, id2, tracks, options.verbose)
    scan_files(tracks)
    return print_summary(tracks, options.verbose)
Example #3
0
def main(options):
    utils.check_dependencies(BIN, REQUIRED)
    tracks = [Track(path) for path in options.paths]

    cddb, id1, id2 = get_disc_ids(tracks, options.additional_sectors,
                                  options.data_track_len, options.verbose)
    print('Disc ID: %08x-%08x-%08x' % (id1, id2, cddb))
    get_ar_entries(cddb, id1, id2, tracks, options.verbose)
    scan_files(tracks)
    return print_summary(tracks, options.verbose)
Example #4
0
def main(options):
    utils.check_dependencies(BIN, REQUIRED)
    sources = [dict(path=p) for p in options.paths]

    for s in sources:
        s['num_samples'] = utils.get_num_samples(BIN, s['path'])
        if s['num_samples'] % 588 != 0:
            msg = "%s not from CD (%i samples)\n" % (s['path'],
                                                     s['num_samples'])
            raise utils.NotFromCDError(msg)
    output_dir = fix_offset(sources, options.offset, options.format,
                            options.verbose)
    print_summary(sources, output_dir)

    return 0
Example #5
0
def main(options):
    utils.check_dependencies(BIN, REQUIRED)
    sources = [dict(path=p) for p in options.paths]

    for s in sources:
        s['num_samples'] = utils.get_num_samples(BIN, s['path'])
        if s['num_samples'] % 588 != 0:
            msg = "%s not from CD (%i samples)\n" % (s['path'],
                                                     s['num_samples'])
            raise utils.NotFromCDError(msg)
    output_dir = fix_offset(sources, options.offset, options.format,
                            options.verbose)
    print_summary(sources, output_dir)

    return 0
Example #6
0
def main():
    signal(SIGINT, sig_handler)
    args = parse_args()
    default_branch = args.branch

    username = utils.get_username(args)
    if args.gerrit == "submit":
        gerrit.submit(default_branch, username, args.owner)
        sys.exit(0)
    elif args.gerrit == "vote":
        gerrit.vote(default_branch, username, args.owner)
        sys.exit(0)

    base_path = utils.get_base_path(default_branch)
    config_dict = utils.get_config_dict(args.config, default_branch)

    if args.path_to_crowdin == "crowdin" and not utils.check_dependencies():
        sys.exit(1)

    if args.upload_sources:
        upload.upload_sources_crowdin(default_branch, config_dict,
                                      args.path_to_crowdin)
    elif args.upload_translations:
        upload.upload_translations_crowdin(default_branch, config_dict,
                                           args.path_to_crowdin)
    elif args.download:
        xml_files = utils.get_xml_files(base_path, default_branch)
        download.download_crowdin(
            base_path,
            default_branch,
            xml_files,
            username,
            config_dict,
            args.path_to_crowdin,
        )
    elif args.unzip:
        xml_files = utils.get_xml_files(base_path, default_branch)
        from_zip.unzip(args.unzip, base_path, default_branch, xml_files,
                       username)

    if download.has_created_commits() or upload.has_uploaded():
        print("\nDone!")
        sys.exit(0)
    else:
        print("\nNothing to commit")
        sys.exit(2)
def list(jobname, color, bucket):
    check_dependencies(False, False)
    do_list(jobname, color, bucket)
def list_buckets(color):
    check_dependencies(False, False)
    do_list_buckets(color)