weboob.core.repositories

class weboob.core.repositories.IProgress

Bases: object

error(message)
progress(percent, message)
prompt(message)
exception weboob.core.repositories.InvalidSignature(filename)

Bases: exceptions.Exception

class weboob.core.repositories.Keyring(path)

Bases: object

EXTENSION = '.gpg'
exists()
static find_gpg()
static find_gpgv()
is_valid(data, sigdata)

Check if the data is signed by an accepted key. data and sigdata should be strings.

save(keyring_data, version)
class weboob.core.repositories.ModuleInfo(name)

Bases: object

Information about a module available on a repository.

dump()
has_caps(*caps)

Return True if module implements at least one of the caps.

is_installed()
is_local()
load(items)
class weboob.core.repositories.PrintProgress

Bases: weboob.core.repositories.IProgress

error(message)
progress(percent, message)
prompt(message)
class weboob.core.repositories.Repositories(workdir, datadir, version)

Bases: object

ICONS_DIR = 'icons'
KEYRINGS_DIR = 'keyrings'
MODULES_DIR = 'modules'
REPOS_DIR = 'repositories'
SHARE_DIRS = ['modules', 'repositories', 'keyrings', 'icons']
SOURCES_LIST = 'sources.list'
check_repositories()

Check if sources.list is consistent with repositories

create_dir(name)
get_all_modules_info(caps=None)

Get all ModuleInfo instances available.

Parameters:caps (list[str]) – filter on capabilities:
Return type:dict[ModuleInfo]
get_module_icon_path(module)
get_module_info(name)

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.

install(module, progress=<PrintProgress>)

Install a module.

Parameters:
load()

Load repositories from ~/.local/share/weboob/repositories/.

load_browser()
retrieve_icon(module)

Retrieve the icon of a module and save it in ~/.local/share/weboob/icons/.

update(progress=<PrintProgress>)

Update repositories and install new packages versions.

Parameters:progress (IProgress) – observer object.
update_repositories(progress=<PrintProgress>)
static url2filename(url)

Get a safe file name for an URL.

All non-alphanumeric characters are replaced by _.

class weboob.core.repositories.Repository(url)

Bases: object

Represents a repository.

INDEX = 'modules.list'
KEYDIR = '.keys'
KEYRING = 'trusted.gpg'
build_index(path, filename)

Rebuild index of modules of repository.

Parameters:
  • path (str) – path of the repository
  • filename (str) – file to save index
static get_tree_mtime(path, include_root=False)
localurl2path()

Get a local path of a file:// URL.

parse_index(fp)

Parse index of a repository

Parameters:fp (buffer) – file descriptor to read
retrieve_index(browser, repo_path)

Retrieve the index file of this repository. It can use network if this is a remote repository.

Parameters:repo_path (str) – path to save the downloaded index file.
retrieve_keyring(browser, keyring_path, progress)
save(filename, private=False)

Save repository into a file (modules.list for example).

Parameters:
  • filename (str) – path to file to save repository.
  • private (bool) – if enabled, save URL of repository.
exception weboob.core.repositories.RepositoryUnavailable

Bases: exceptions.Exception

Repository in not available.

class weboob.core.repositories.Versions(path)

Bases: object

VERSIONS_LIST = 'versions.list'
get(name)
save()
set(name, version)
weboob.core.repositories.open_for_config(filename)