errbot.repo_manager module

class errbot.repo_manager.BotRepoManager(storage_plugin: StoragePluginBase, plugin_dir: str, plugin_indexes: Tuple[str, ...])[source]

Bases: StoreMixin

Manages the repo list, git clones/updates or the repos.

__init__(storage_plugin: StoragePluginBase, plugin_dir: str, plugin_indexes: Tuple[str, ...]) None[source]

Make a repo manager. :type plugin_dir: str :type storage_plugin: StoragePluginBase :param storage_plugin: where the manager store its state. :param plugin_dir: where on disk it will git clone the repos. :param plugin_indexes: a list of URL / path to get the json repo index.

add_plugin_repo(name: str, url: str) None[source]
check_for_index_update() None[source]
get_all_repos_paths() List[str][source]
get_installed_plugin_repos() Dict[str, str][source]
get_repo_from_index(repo_name: str) List[RepoEntry][source]

Retrieve the list of plugins for the repo_name from the index.

Parameters:

repo_name (str) – the name of the repo

Returns:

a list of RepoEntry

index_update() None[source]
install_repo(repo: str) str[source]

Install the repository from repo

Return type:

str

Parameters:

repo (str) –

The url, git url or path on disk of a repository. It can point to either a git repo or

a .tar.gz of a plugin

Returns:

The path on disk where the repo has been installed on.

Raises:

RepoException if an error occured.

search_repos(query: str) Generator[RepoEntry, None, None][source]

A simple search feature, keywords are AND and case insensitive on all the fields.

Parameters:

query (str) – a string query

Returns:

an iterator of RepoEntry

set_plugin_repos(repos: Dict[str, str]) None[source]

Used externally.

shutdown() None[source]
uninstall_repo(name: str) None[source]
update_all_repos() Generator[Tuple[str, int, str], None, None][source]
update_repos(repos) Generator[Tuple[str, int, str], None, None][source]

This git pulls the specified repos on disk. Yields tuples like (name, success, reason)

class errbot.repo_manager.RepoEntry(entry_name, name, python, repo, path, avatar_url, documentation)

Bases: tuple

avatar_url

Alias for field number 5

documentation

Alias for field number 6

entry_name

Alias for field number 0

name

Alias for field number 1

path

Alias for field number 4

python

Alias for field number 2

repo

Alias for field number 3

exception errbot.repo_manager.RepoException[source]

Bases: Exception

errbot.repo_manager.check_dependencies(req_path: Path) Tuple[str | None, Sequence[str]][source]

This methods returns a pair of (message, packages missing). Or None, [] if everything is OK.

errbot.repo_manager.human_name_for_git_url(url: str) str[source]
errbot.repo_manager.makeEntry(repo_name: str, plugin_name: str, json_value: dict) RepoEntry[source]
errbot.repo_manager.tokenizeJsonEntry(json_dict: dict) set[source]

Returns all the words in a repo entry.

errbot.repo_manager.which(program: str) str | None[source]