reviewboard.themes.ui.registry¶
Registries for Review Board UI theme support.
New in version 7.0.
- class UIThemeRegistry[source]¶
Bases:
OrderedRegistry
[BaseUITheme
]Registry for managing available Review Board UI themes.
This provides functionality for looking up available UI themes, determining a default theme, and registering new themes.
Changed in version 7.1: The
system
theme is now the default when using thedefault
theme.New in version 7.0.
- lookup_attrs: Sequence[str] = ['theme_id'][source]¶
A list of attributes that items can be looked up by.
- get_theme(theme_id: str) Optional[BaseUITheme] [source]¶
Return a theme with the specified ID.
A special value of “default” will always return the default theme ID.
- Parameters:
theme_id (
str
) – The ID of the theme to return.- Returns:
The theme instance, or
None
if not found.- Return type:
- get_default_theme_id() str [source]¶
Return the ID of the default theme for the UI.
If the site configuration contains a
default_ui_theme
value, then that theme ID will be returned, if found in the registry.This will always fall back to
DEFAULT_THEME_ID
if a configured value is not found.- Returns:
The default theme ID.
- Return type:
- get_defaults() Iterator[BaseUITheme] [source]¶
Return defaults for the registry.
- Yields:
type
– Each default UI theme.
- __annotations__ = {'_by_id': 'Dict[int, RegistryItemType]', '_items': 'set[RegistryItemType]', '_key_order': 'List[int]', '_lock': 'RLock', '_registry': 'dict[str, dict[object, RegistryItemType]]', 'already_registered_error_class': 'Type[AlreadyRegisteredError]', 'default_errors': 'RegistryErrorsDict', 'errors': 'RegistryErrorsDict', 'item_name': 'Optional[str]', 'lookup_attrs': 'Sequence[str]', 'lookup_error_class': 'Type[ItemLookupError]', 'state': 'RegistryState'}¶
- __orig_bases__ = (reviewboard.registries.registry.OrderedRegistry[reviewboard.themes.ui.base.BaseUITheme],)¶
- __parameters__ = ()¶