OpenAssetIO
An abstract API for generalising interactions between a host application and an asset management system
|
The Mapper class provides string substitution methods and lookups to determine the correct terminology for the supplied manager. More...
Public Member Functions | |
def | __init__ (self, manager, terminology=defaultTerminology) |
Constructs a new Mapper using terminology overrides defined by the supplied Manager. More... | |
def | replaceTerms (self, sourceStr) |
Substitutes any valid terminology tokens in the input string with those appropriate to the current Manager. More... | |
def | term (self, key, default="") |
Returns the term corresponding to the supplied key, openassetio.hostApi.terminology under kTerm_*. More... | |
The Mapper class provides string substitution methods and lookups to determine the correct terminology for the supplied manager.
def __init__ | ( | self, | |
manager, | |||
terminology = defaultTerminology |
|||
) |
Constructs a new Mapper using terminology overrides defined by the supplied Manager.
The manager is queried during construction and it's results cached for the lifetime of the Mapper.
manager | Manager, A Manager instance, whose terminology should be applied by the mapper. |
terminology | A dict of terms that will be substituted by this instance. If left unspecified, the default API terminology will be used. Hosts may take a copy of this dictionary and append to it before passing to the Mapper to allow managers to customize additional host-specific terms. There is no expectation that a manager would handle new terms without specific knowledge in advance. |
def replaceTerms | ( | self, | |
sourceStr | |||
) |
Substitutes any valid terminology tokens in the input string with those appropriate to the current Manager.
These tokens are as per python format convention, using the constants defined in openassetio.hostApi.terminology under kTerm_*. For example:
{{
is not currently supported.sourceStr | a string to substitute. |
def term | ( | self, | |
key, | |||
default = "" |
|||
) |
Returns the term corresponding to the supplied key, openassetio.hostApi.terminology under kTerm_*.
Copyright 2013-2023 The Foundry Visionmongers Ltd. OpenAssetIO is released under the Apache 2.0 License