def contains_program(location): program_dir = os.path.join(location, 'program') if os.path.isdir(program_dir): installation = dict(location=location, program=program_dir) soffice = executable_in_dir('soffice', program_dir) if soffice: installation['soffice'] = soffice unopkg = executable_in_dir('unopkg', program_dir) if unopkg: installation['unopkg'] = unopkg program_python = executable_in_dir('python', program_dir) if program_python: uno_python = python_import_uno(program_python) if uno_python: installation.update(resolve_uno_components(uno_python)) basis_link = os.path.join(location, 'basis-link') if os.path.islink(basis_link): location = os.path.realpath(basis_link) ure = find_ure(location) if ure: installation['ure'] = ure return installation
def contains_libreoffice(dir): return executable_in_dir('libreoffice', dir)