Don't fail get_kwarg when self.kwarg[name] is falsey
This commit is contained in:
parent
77126e5807
commit
18004c23e1
1 changed files with 5 additions and 2 deletions
|
@ -42,8 +42,11 @@ class EventCallback(object):
|
||||||
return self.function(event)
|
return self.function(event)
|
||||||
|
|
||||||
def get_kwarg(self, name: str, default=None) -> typing.Any:
|
def get_kwarg(self, name: str, default=None) -> typing.Any:
|
||||||
item = self.kwargs.get(name, default)
|
if name in self.kwargs:
|
||||||
return item or self.docstring.items.get(name, default)
|
return self.kwargs[name]
|
||||||
|
elif name in self.docstring.items:
|
||||||
|
return self.docstring.items[name]
|
||||||
|
return default
|
||||||
|
|
||||||
class EventHook(object):
|
class EventHook(object):
|
||||||
def __init__(self, log: Logging.Log, name: str = None,
|
def __init__(self, log: Logging.Log, name: str = None,
|
||||||
|
|
Loading…
Reference in a new issue