diff options
| author | 2019-06-14 11:42:12 +0100 | |
|---|---|---|
| committer | 2019-06-14 11:42:12 +0100 | |
| commit | d7fa2cfa24439e86483139f2823e819c67321aaf (patch) | |
| tree | 0e100e5f6d26180da5f276a5c9c5ade0a90cfcc6 /src/utils/__init__.py | |
| parent | Update CHANGELOG.md (diff) | |
| signature | ||
Catch `yield`s in command callbacks for e.g. permission checks
Diffstat (limited to 'src/utils/__init__.py')
| -rw-r--r-- | src/utils/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils/__init__.py b/src/utils/__init__.py index d7a3d968..869690ff 100644 --- a/src/utils/__init__.py +++ b/src/utils/__init__.py @@ -185,6 +185,11 @@ def export(setting: str, value: typing.Any): return module return _export_func +class Check(object): + def __init__(self, request: str, *args: typing.List[str]): + self.request = request + self.args = args + TOP_10_CALLABLE = typing.Callable[[typing.Any], typing.Any] def top_10(items: typing.Dict[typing.Any, typing.Any], convert_key: TOP_10_CALLABLE=lambda x: x, |
