Ejemplo n.º 1
0
 def find_mingw_bin():
     pathdirs = ut.get_path_dirs()
     copydir = None
     # hueristic for finding mingw bin
     for pathdir in pathdirs:
         pathdir_ = pathdir.lower()
         ismingwbin = pathdir_.find("mingw") > -1 and pathdir_.endswith("bin")
         if ismingwbin:
             issmaller = copydir is None or len(pathdir) < len(copydir)
             if issmaller:
                 copydir = pathdir
     return copydir
Ejemplo n.º 2
0
 def find_mingw_bin():
     pathdirs = ut.get_path_dirs()
     copydir = None
     # hueristic for finding mingw bin
     for pathdir in pathdirs:
         pathdir_ = pathdir.lower()
         ismingwbin = (pathdir_.find('mingw') > -1 and pathdir_.endswith('bin'))
         if ismingwbin:
             issmaller = (copydir is None or len(pathdir) < len(copydir))
             if issmaller:
                 copydir = pathdir
     return copydir
Ejemplo n.º 3
0
def assert_modules():
    """
    checkinfo functions return info_dict
    checkinfo_func

    CommandLine:
        python -m ibeis.tests.assert_modules --test-assert_modules

    Example:
        >>> # DOCTEST_ENABLE
        >>> from ibeis.tests.assert_modules import *   # NOQA
        >>> detailed_msg = assert_modules()
        >>> print(detailed_msg)
    """

    MACHINE_NAME = ut.get_computer_name()

    machine_info_lines = []

    machine_info_lines.append('sys.version = %r ' % (sys.version))
    machine_info_lines.append('PATH = ' + ut.list_str(ut.get_path_dirs()))
    machine_info_lines.append('\n\n\n============================')
    machine_info_lines.append('Begining assert modules main')
    machine_info_lines.append('* MACHINE_NAME = %r' % MACHINE_NAME)
    machine_info_text = '\n'.join(machine_info_lines)
    print(machine_info_text)

    statustext_list = []
    failed_list = []
    fix_list = []

    SHOW_STATUS = not ut.get_argflag(('--nostatus', '--nostat'))

    for checkinfo_wrapper in ASSERT_FUNCS:
        passed, current_version, target, infodict, statustext, suggested_fix = checkinfo_wrapper()
        funcname = get_funcname(checkinfo_wrapper)
        if SHOW_STATUS:
            statustext_list.append(statustext)
        if passed:
            statustext_list.append(funcname + ' ' + str(infodict['__version__']) + ' passed')
            #statustext_list.append('')
        else:
            failed_list.append(funcname + ' FAILED!!!')
            fix_list.append(suggested_fix)
            statustext_list.append(funcname + ' FAILED!!!')
        if SHOW_STATUS:
            statustext_list.append('')

    output_text = '\n'.join(statustext_list)

    failed_text = '\n'.join(failed_list)
    print(output_text)
    print(failed_text)
    check_exist_text = check_modules_exists()
    print(check_exist_text)
    fix_text = ''
    if len(fix_list) > 0:
        fix_text += ('suggested fixes:\n')
        fix_text += ('\n'.join(fix_list) + '\n')
        print(fix_text)

    detailed_msg = '\n'.join([
        machine_info_text,
        output_text,
        failed_text,
        check_exist_text,
        fix_text,
    ])

    return detailed_msg