woob.core.repositories
¶
Bases:
Exception
Repository in not available.
- class Repository(url)[source]¶
Bases:
object
Represents a repository.
- INDEX = 'modules.list'¶
- KEYDIR = '.keys'¶
- KEYRING = 'trusted.gpg'¶
- retrieve_index(browser, repo_path)[source]¶
Retrieve the index file of this repository. It can use network if this is a remote repository.
- Parameters:
repo_path (str or None) – path to save the downloaded index file (if any).
- parse_index(fp)[source]¶
Parse index of a repository
- Parameters:
fp (buffer) – file descriptor to read
- recursive_deps(direct_deps, key, result=None)[source]¶
take a dict of direct dependencies and get all dependencies of an element
>>> recursive_deps({1: {2, 3}, 2: {3}, 3: {4}, 4: set()}, 1) {2, 3, 4}
- dependency_sort(deps_rules)[source]¶
>>> dependency_sort({1: {2}, 2: {4}, 3: set(), 4: {3}}) [3, 4, 2, 1]
- class Repositories(workdir, datadir, version)[source]¶
Bases:
object
- SOURCES_LIST = 'sources.list'¶
- MODULES_DIR = 'modules'¶
- MODULES_SUBDIR = 'woob_modules'¶
- REPOS_DIR = 'repositories'¶
- KEYRINGS_DIR = 'keyrings'¶
- ICONS_DIR = 'icons'¶
- SHARE_DIRS = ['modules', 'repositories', 'keyrings', 'icons']¶
- namespace_package_content = 'from pkgutil import extend_path\n__path__ = extend_path(__path__, __name__)\n'¶
- get_all_modules_info(caps=None)[source]¶
Get all ModuleInfo instances available.
- Parameters:
- Return type:
dict[
ModuleInfo
]
- get_module_info(name)[source]¶
Get ModuleInfo object of a module.
It tries all repositories from last to first, and set the ‘path’ attribute of ModuleInfo if it is installed.
- retrieve_icon(module)[source]¶
Retrieve the icon of a module and save it in ~/.local/share/woob/icons/.
- update_repositories(progress=PrintProgress())[source]¶
Update list of repositories by downloading them and put them in ~/.local/share/woob/repositories/.
- Parameters:
progress (
IProgress
) – observer object. (default:PrintProgress()
)
- update(progress=PrintProgress())[source]¶
Update repositories and install new packages versions.
- Parameters:
progress (
IProgress
) – observer object. (default:PrintProgress()
)
- static url2filename(url)[source]¶
Get a safe file name for an URL.
All non-alphanumeric characters are replaced by _.
- property errors¶