def get_version(dependency_dictionary): """Tries to determine a bundle version. """ distro = guess_system() if not dependency_dictionary.has_key(distro): return None else: callable_ = getattr(core.bundles.checkbundle, distro.replace('-', '_') + '_get_version') return callable_(dependency_dictionary[distro])
def install(dependency_dictionary): """Tries to import a python module. If unsuccessful, tries to install the appropriate bundle and then reimport. py_import tries to be smart about which system it runs on.""" # Ugly fix to avoid circular import distro = guess_system() if distro not in dependency_dictionary: return False else: files = dependency_dictionary[distro] if show_question(files): callable_ = getattr(gui.bundles.installbundle, distro.replace('-', '_') + '_install') return callable_(files) else: return False