diff options
| author | 2019-02-07 10:02:27 +0000 | |
|---|---|---|
| committer | 2019-02-07 10:02:27 +0000 | |
| commit | 8c1c10b3c7aa9edde8b4ca98ca025a66ba371344 (patch) | |
| tree | 3710017ff078da23615d5b1d466058ea91206a4a | |
| parent | `commit_comment` events have `commit_id` in `comment`, not in the root data (... (diff) | |
| signature | ||
Implement `Exports.get_one()`
| -rw-r--r-- | src/Exports.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Exports.py b/src/Exports.py index b0cb2043..f5b8852a 100644 --- a/src/Exports.py +++ b/src/Exports.py @@ -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: |
