def dll_lookup_mirao52e(): tups = [('mirao52e.dll', r'^mirao52e\.dll$')] for dll_name, dll_pat in tups: here = path.dirname(path.realpath(__file__)) target = path.join(here, dll_name) found = path.isfile(target) log.debug(f'here: {here}; found: {found}') if not found: expats = ['i386'] tops = get_paths('mirao52e') try: dllpath = path.dirname(find_file(tops, dll_pat, expats=expats)) except ValueError: log.debug(f'Unable to find Mirao52e\'s {dll_name}. ' + 'Is the driver installed?') return src = path.join(dllpath, dll_name) copyfile(src, target) log.debug(f'copied: {src} to {target}') here = path.dirname(path.realpath(__file__)) target = path.join(here, 'ftd2xx.dll') found = path.isfile(target) log.debug(f'here: {here}; found: {found}') if not found: expats = ['i386'] tops = get_paths('mirao52e') try: dllpath = path.dirname( find_file(tops, r'^ftd2xx64\.dll$', expats=expats)) except ValueError: log.debug(f'Unable to find Mirao52e\'s ftd2xx64.dll. ' + 'Is the driver installed?') return src = path.join(dllpath, 'ftd2xx64.dll') copyfile(src, target) log.debug(f'copied: {src} to {target}')
def dll_lookup_sdk3(): dll_name = 'atcore.dll' dll_pat = r'^atcore\.dll$' here = path.dirname(path.realpath(__file__)) target = path.join(here, dll_name) found = path.isfile(target) log.debug(f'here: {here}; found: {found}') if not found: tops = get_paths('sdk3') try: dllpath = path.dirname(find_file(tops, dll_pat, expats=[])) except ValueError: log.debug(f'Unable to find SDK3\'s {dll_name}. ' + 'Is the driver installed?') return src = path.join(dllpath, dll_name) copyfile(src, target) log.debug(f'copied: {src} to {target}')
def dll_lookup_ximea(): dll_name = 'xiapi64.dll' dll_pat = r'^xiapi64\.dll$' here = path.dirname(path.realpath(__file__)) target = path.join(here, dll_name) found = path.isfile(target) log.debug(f'here: {here}; found: {found}') if not found: expats = ['32bit'] tops = get_paths('ximea') try: dllpath = path.dirname(find_file(tops, dll_pat, expats=expats)) except ValueError: log.debug(f'Unable to find Ximea\'s {dll_name}. ' + 'Is the driver installed?') return src = path.join(dllpath, dll_name) copyfile(src, target) log.debug(f'copied: {src} to {target}')
def dll_lookup_bmc(): dll_pat = r'^BMC[0-9]+\.dll$' here = path.dirname(path.realpath(__file__)) try: find_file([here], dll_pat, expats=[]) return except ValueError: pass tops = get_paths('bmc') try: dll_path = find_file(tops, dll_pat, expats=[]) except ValueError: log.debug('Unable to find BMC\'s DLL. Is the driver installed?') return dll_name = path.basename(dll_path) target = path.join(here, dll_name) found = path.isfile(target) log.debug(f'here: {here}; found: {found}') copyfile(dll_path, target) log.debug(f'copied: {dll_path} to {target}')