nrcatalogtools.registry¶
Lightweight catalog plugin registry.
Catalogs register themselves with @register_catalog("TAG") and are looked up with
get_catalog("TAG"). The built-in catalogs (RIT, SXS, MAYA) are registered automatically
at import time.
register_catalog
¶
Class decorator that registers a catalog under tag.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
str
|
Short uppercase identifier (e.g. |
required |
Returns:
| Type | Description |
|---|---|
callable
|
A class decorator; the class itself is returned unchanged so the decorator can be stacked with other decorators. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If tag is already registered, to prevent silent overwrites. |
Examples:
Source code in nrcatalogtools/registry.py
get_catalog
¶
Return the catalog class registered under tag.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
str
|
Short uppercase identifier (e.g. |
required |
Returns:
| Type | Description |
|---|---|
type
|
The registered catalog class. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If tag is not in the registry. |
Examples:
Source code in nrcatalogtools/registry.py
list_catalogs
¶
Return the set of all registered catalog tags.
Returns:
| Type | Description |
|---|---|
set[str]
|
Copy of the current tag set; modifying it has no effect on the registry. |
Examples: