tlc.client.helpers#

Miscellaneous helper functions.

Module Contents#

Functions#

Function

Description

active_run

Return the active Run, if any.

set_active_run

Set the active Run.

active_project_name

Return the active project name, if any.

register_url_alias

Register an alias for a URL.

unregister_url_alias

Unregister an alias for a URL.

get_registered_url_aliases

Return the registered URL aliases.

API#

tlc.client.helpers.active_run() tlc.core.objects.mutable_objects.run.Run | None#

Return the active Run, if any.

tlc.client.helpers.set_active_run(run: tlc.core.objects.mutable_objects.run.Run | tlc.core.url.Url) None#

Set the active Run.

tlc.client.helpers.active_project_name() str | None#

Return the active project name, if any.

tlc.client.helpers.register_url_alias(token: str, path: str, force: bool = True) 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.

tlc.client.helpers.unregister_url_alias(token: str) None#

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.

tlc.client.helpers.get_registered_url_aliases() dict[str, str]#

Return the registered URL aliases.

Returns:

A dictionary mapping alias tokens to paths.