Ejemplo n.º 1
0
def files_diff(**kwargs):
    """
    (fp files_diff --help for more help on that command)
    """
    """
    >>> import lib_doctest
    >>> kwargs = dict()
    >>> kwargs['fp1'] = './testfiles_source/fp_files_result1_difftest.csv'
    >>> kwargs['fp2'] = './testfiles_source/fp_files_result2_difftest.csv'
    >>> kwargs['f_output'] = './testresults/fp_files_diff_1_2.csv'
    >>> kwargs['batchmode'] = True
    >>> logger.level=logging.ERROR
    >>> files_diff(**kwargs)  # +ELLIPSIS, +NORMALIZE_WHITESPACE

    """

    diff_files_save_commandline_options_to_conf(**kwargs)
    lib_helper_functions.setup_console_logger()
    logger.info('create file fingerprint diff {}'.format(fp_conf.version))

    fp_diff_files_conf.fp1_path = check_or_request_fp_file(
        f_input_file=fp_diff_files_conf.fp1_path, file_number=1)
    fp_diff_files_conf.fp2_path = check_or_request_fp_file(
        f_input_file=fp_diff_files_conf.fp2_path, file_number=2)
    check_or_request_f_output()
    lib_helper_functions.SetupFileLogging(f_output=fp_conf.f_output)
    log_files_diff_parameter()
    with lib_diff_files.FileDiff() as file_diff:
        file_diff.create_diff_file()
    exit_message()
Ejemplo n.º 2
0
def files(**kwargs):
    """
    (fp files --help for more help on that command)
    """
    """
    >>> import test
    >>> import lib_doctest
    >>> lib_doctest.setup_doctest_logger()
    >>> timestamp = time.time()
    >>> test.create_testfiles_fingerprint_1(timestamp)
    >>> kwargs=dict()
    >>> kwargs['fp_dir'] = './testfiles/'
    >>> kwargs['f_output'] = './testresults/fp_files_result1.csv'
    >>> kwargs['batchmode'] = True
    >>> kwargs['no_admin'] = True
    >>> kwargs['no_mp'] = False
    >>> kwargs['no_hashing'] = False

    >>> logger.level=logging.ERROR
    >>> files(**kwargs)  # +ELLIPSIS, +NORMALIZE_WHITESPACE

    >>> test.modify_testfiles_fingerprint_2(timestamp)
    >>> kwargs['f_output'] = './testresults/fp_files_result2.csv'
    >>> logger.level=logging.ERROR
    >>> files()  # +ELLIPSIS, +NORMALIZE_WHITESPACE

    >>> kwargs['no_mp'] = True
    >>> logger.level=logging.ERROR
    >>> files()  # +ELLIPSIS, +NORMALIZE_WHITESPACE

    >>> kwargs['no_hashing'] = True
    >>> logger.level=logging.ERROR
    >>> files()  # +ELLIPSIS, +NORMALIZE_WHITESPACE


    """
    files_save_commandline_options_to_conf(**kwargs)
    lib_helper_functions.setup_console_logger()
    lib_helper_functions.inform_if_not_run_as_admin(
        exit_if_not_admin=fp_files_conf.exit_if_not_admin,
        interactive=fp_conf.interactive)
    logger.info('create files fingerprint {}'.format(fp_conf.version))
    check_or_request_fp_dir()
    check_or_request_f_output()
    lib_helper_functions.SetupFileLogging(f_output=fp_conf.f_output)
    log_files_parameter()
    with lib_fp_files.FingerPrintFiles() as fingerprint_files:
        if fp_files_conf.multiprocessing:  # test c:\windows : 66 seconds
            fingerprint_files.create_fp_mp()
        else:
            fingerprint_files.create_fp()  # test c:\windows : 124 seconds
    exit_message()
Ejemplo n.º 3
0
def reg(**kwargs):
    """
    (fp reg --help for more help on that command)
    """

    reg_save_commandline_options_to_conf(**kwargs)
    lib_helper_functions.setup_console_logger()
    lib_helper_functions.inform_if_not_run_as_admin(
        exit_if_not_admin=fp_reg_conf.exit_if_not_admin,
        interactive=fp_conf.interactive)
    logger.info('create registry fingerprint {}'.format(fp_conf.version))
    check_or_request_f_output(fp_conf.f_output)
    lib_helper_functions.SetupFileLogging(f_output=fp_conf.f_output)
    log_reg_parameter()
    with lib_fp_registry.FingerPrintRegistry() as fingerprint_registry:
        fingerprint_registry.create_fingerprint_registry()
    exit_message()