tlc.helpers.project_helper¶

Helper methods for project-level operations beyond layout/path construction.

Module Contents¶

Classes¶

Class

Description

ProjectHelper

Helper methods for project-level operations.

API¶

class ProjectHelper¶

Helper methods for project-level operations.

This class provides static helpers for project functionality that goes beyond URL/path construction (which lives in ProjectLayout).

static register_project_url_alias(
token: str,
path: str | Url,
*,
project_name: str | None = None,
root_url: Url | str | None = None,
force: bool = False,
) None¶

Register and persist a URL alias for a project.

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.

  • project_name – The project name.

  • root_url – The root URL.

  • force – If True, overwrite an existing registration that points to a different path. Defaults to False so two unrelated callers that both try to claim the same token surface as a conflict rather than silently last-writer-wins.

Raises:

AliasConflictError – If the token is already registered with a different path and force=False.