Implement Exports.get_one()
This commit is contained in:
parent
d013703705
commit
8c1c10b3c7
1 changed files with 3 additions and 0 deletions
|
@ -29,6 +29,9 @@ class Exports(object):
|
|||
return self._exports.get(setting, []) + sum([
|
||||
exports.get(setting, []) for exports in
|
||||
self._context_exports.values()], [])
|
||||
def get_one(self, setting: str) -> typing.Optional[typing.Any]:
|
||||
values = self.get_all(setting)
|
||||
return values[0] if values else None
|
||||
|
||||
def purge_context(self, context: str):
|
||||
if context in self._context_exports:
|
||||
|
|
Loading…
Reference in a new issue