tlc.client.helpers
¶
Miscellaneous helper functions.
Module Contents¶
Functions¶
Function |
Description |
---|---|
Return the active Run, if any. |
|
Set the active Run. |
|
Return the active project name, if any. |
|
Register an alias for a URL. |
|
Unregister an alias for a URL. |
|
Return the registered URL aliases. |
|
Register and persist a project URL alias. |
API¶
- register_url_alias( ) None ¶
Register an alias for a URL.
- Parameters:
token – The alias token to register. Must be match the regex
[A-Z][A-Z0-9_]*
.path – The path to alias.
force – If True, force the registration of the alias even if it is already registered.
- Raises:
ValueError – If the token is already registered and force is False.
- unregister_url_alias(
- token: str,
Unregister an alias for a URL.
- Parameters:
token – The alias token to unregister. Must match the regex
[A-Z][A-Z0-9_]*
.- Raises:
KeyError – If the token is not registered.
- get_registered_url_aliases() dict[str, str] ¶
Return the registered URL aliases.
- Returns:
A dictionary mapping alias tokens to paths.
- register_project_url_alias(
- token: str,
- path: str | Url | Path,
- force: bool = True,
- project: str | None = None,
- root: str | None = None,
Register and persist a project URL alias.
A project URL alias is a per-project alias that is persisted in the project’s configuration file and will be loaded for other users that share the same project but not necessarily the same startup-config. The alias is also registered in the current session and is immediately available for use.
- Parameters:
token – The alias token to register. Must match the regex
[A-Z][A-Z0-9_]*
.path – The path to alias.
force – If True, force the registration of the alias even if it is already registered.
project – The project name. If None, the active project is used.
root – The root name. If None, the active root is used.
- Raises:
ValueError – If the token is already registered and force is False.