예제 #1
0
파일: libdar_test.py 프로젝트: valdisvi/DAR
def f6():
    opt = libdar.archive_options_read()
    passwd ="*****@*****.**"
    secu_pass = libdar.secu_string(passwd, len(passwd))
    entrepot = libdar.entrepot_libcurl(ui,
                                       libdar.mycurl_protocol.proto_ftp,
                                       "anonymous",
                                       secu_pass,
                                       "ftp.dm3c.org",
                                       "",
                                       False,
                                       "",
                                       "",
                                       "",
                                       5)
    print(entrepot.get_url())
    opt.set_entrepot(entrepot)
    opt.set_info_details(True)

    arch2 = libdar.archive(ui,
                           libdar.path("/dar.linux.free.fr/"),
                           "exemple",
                           "dar",
                           opt)

    opt2 = libdar.archive_options_test()
    opt2.set_display_treated(True, False)
    arch2.op_test(opt2)
예제 #2
0
파일: libdar_test.py 프로젝트: valdisvi/DAR
def f4():
    opt = libdar.archive_options_read()
    arch1 = libdar.archive(ui,
                           sauv_path,
                           arch_name,
                           ext,
                           opt);

    opt = libdar.archive_options_test()

    # defining which file to test bases on filename (set_selection)
    mask_file1 = libdar.simple_mask("*.*", True)
    mask_file2 = libdar.regular_mask(".*\.pub$", True)
    mask_filenames = libdar.ou_mask() # doing the logical OR between what we will add to it:
    mask_filenames.add_mask(mask_file1)
    mask_filenames.add_mask(mask_file2)
    opt.set_selection(mask_filenames)

    # reducing the testing in subdirectories
    tree1 = libdar.simple_path_mask("/etc/ssh", False)
    tree2 = libdar.simple_path_mask("/etc/grub.d", False)
    tree = libdar.et_mask() # doing the loical AND betwen what we will add to it:
    tree.add_mask(libdar.not_mask(tree1))
    tree.add_mask(libdar.not_mask(tree2))
    opt.set_subtree(tree)

    opt.set_info_details(True)
    opt.set_display_skipped(True)

    arch1.op_test(opt)