diff --git a/src/Exports.py b/src/Exports.py index a08b4734..615f5812 100644 --- a/src/Exports.py +++ b/src/Exports.py @@ -29,7 +29,8 @@ 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]: + def get_one(self, setting: str, default: typing.Any=None + ) -> typing.Optional[typing.Any]: values = self.get_all(setting) return values[0] if values else None @@ -46,5 +47,6 @@ class ExportsContext(object): self._parent._context_add(self.context, setting, value) def get_all(self, setting: str) -> typing.List[typing.Any]: return self._parent.get_all(setting) - def get_one(self, setting: str) -> typing.Optional[typing.Any]: - return self._parent.get_one(setting) + def get_one(self, setting: str, default: typing.Any=None + ) -> typing.Optional[typing.Any]: + return self._parent.get_one(setting, default)