Utility Functions
get_active_repo()
Get the active repository.
The active repository is the one that is currently configured in the extension configuration.
RETURNS | DESCRIPTION |
---|---|
AbstractRepository
|
The active repository. |
get_available_exporters()
Retrieve a dictionary of available exporters.
This function collects and returns a dictionary where the keys are exporter names (as strings) and the values are the corresponding exporter classes.
RETURNS | DESCRIPTION |
---|---|
dict[str, type[AbstractExporter]]
|
A dictionary mapping exporter names to their respective exporter classes. |
get_available_repos()
Retrieve a dictionary of available repositories.
This function collects and returns a dictionary where the keys are repository names (as strings) and the values are the corresponding repository classes.
RETURNS | DESCRIPTION |
---|---|
dict[str, type[AbstractRepository]]
|
A dictionary mapping repository names to their respective repository classes. |
get_exporter(exporter_name)
Retrieve an exporter class by name.
This function retrieves an exporter class by name. If the exporter is not found, a ValueError is raised.
PARAMETER | DESCRIPTION |
---|---|
exporter_name
|
The name of the exporter to retrieve.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
type[AbstractExporter]
|
The exporter class. |
get_repo(repo_name)
Retrieve a repository class by name.
This function retrieves a repository class by name. If the repository is not found, a ValueError is raised.
PARAMETER | DESCRIPTION |
---|---|
repo_name
|
The name of the repository to retrieve.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
AbstractRepository
|
The repository class. |
test_active_connection()
Test the connection to the active repository.
When we test the connection, we store the result in the repository object, so we can reuse it later.
RETURNS | DESCRIPTION |
---|---|
bool
|
whether the connection is active |