def uninstall_modules(modules): try: tentacles_manager = TentacleManager(get_bot().get_config()) tentacles_manager.update_list() nb_uninstalled = tentacles_manager.uninstall_parser(modules, False) return f"{nb_uninstalled} uninstalled module(s)" if nb_uninstalled > 1 else f"{modules[0]} uninstalled" except Exception as e: logger.error(f"Error when uninstalling modules: {e}") logger.exception(e) return None
def update_packages(): try: tentacles_manager = TentacleManager(get_bot().get_config()) tentacles_manager.update_list() tentacles_manager.set_force_actions(True) return f"{tentacles_manager.update_parser(None, True)} tentacles up to date" except Exception as e: logger.error(f"Error when updating packages: {e}") logger.exception(e) return None
def reset_packages(): try: tentacles_manager = TentacleManager(get_bot().get_config()) tentacles_manager.update_list() tentacles_manager.reset_tentacles() return "reset successful" except Exception as e: logger.error(f"Error when resetting packages: {e}") logger.exception(e) return None
def install_packages(): try: tentacles_manager = TentacleManager(get_bot().get_config()) tentacles_manager.update_list() tentacles_manager.set_force_actions(True) return f"{tentacles_manager.install_parser(None, True)} installed tentacles" except Exception as e: logger.error(f"Error when installing packages: {e}") logger.exception(e) return False
def update_modules(modules): try: tentacles_manager = TentacleManager(get_bot().get_config()) tentacles_manager.update_list() tentacles_manager.set_force_actions(True) nb_updated = tentacles_manager.update_parser(modules, False) return f"{nb_updated} up to date module(s)" if nb_updated > 1 else f"{modules[0]} up to date" except Exception as e: logger.error(f"Error when updating modules: {e}") logger.exception(e) return None