mtnlion.domain module¶
Tools for defining data on multiple domains.
-
class
mtnlion.domain.
Domain
(*args, **kwargs)[source]¶ Bases:
mtnlion.structures.mountain.Mountain
,typing.Mapping
Implementation of Mountain that verifies that the domains fall within VALID_DOMAINS.
-
domains
¶ Return the domains contained in the object.
- Returns
tuple of domains
-
-
class
mtnlion.domain.
DomainFunction
(func: Callable, domain_names: Union[List[str], Tuple[str]], pass_domain: Optional[bool] = False)[source]¶ Bases:
object
Decorate a given function to run in each of the domains given. The function arguments will be parsed to determine if they are domain aware, and the correct domain will be selected. Otherwise, non domain aware values are passed to the function call exactly the same in every domain.