ProjectRegistry
- class glotaran.project.project_registry.ProjectRegistry(directory: Path, file_suffix: str | Iterable[str], loader: Callable, item_name: str)[source]
Bases:
object
A registry base class.
Initialize a registry.
- Parameters:
Attributes Summary
Get the registry directory.
Whether the registry is empty.
Get the items of the registry.
Methods Summary
Check if the path contains an registry item.
Load an registry item by it's name.
Format the registry items as a markdown text.
Methods Documentation
- property directory: Path
Get the registry directory.
- Returns:
The registry directory.
- Return type:
Path
- property empty: bool
Whether the registry is empty.
- Returns:
Whether the registry is empty.
- Return type:
- is_item(path: Path) bool [source]
Check if the path contains an registry item.
- Parameters:
path (Path) – The path to check.
- Returns:
Whether the path contains an item.
- Return type:
- property items: ItemMapping
Get the items of the registry.
- Returns:
The items of the registry.
- Return type:
- load_item(name: str) Any [source]
Load an registry item by it’s name.
- Parameters:
name (str) – The item name.
- Returns:
The loaded item.
- Return type:
Any
- Raises:
ValueError – Raise if the item does not exist.
- markdown(join_indentation: int = 0) MarkdownStr [source]
Format the registry items as a markdown text.