mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
can_render mechanism for register_output_renderer, closes #770
This commit is contained in:
parent
75cd432e5a
commit
5ab411c733
6 changed files with 108 additions and 18 deletions
|
|
@ -811,6 +811,10 @@ def call_with_supported_arguments(fn, **kwargs):
|
|||
call_with = []
|
||||
for parameter in parameters:
|
||||
if parameter not in kwargs:
|
||||
raise TypeError("{} requires parameters {}".format(fn, tuple(parameters)))
|
||||
raise TypeError(
|
||||
"{} requires parameters {}, missing: {}".format(
|
||||
fn, tuple(parameters), set(parameters) - set(kwargs.keys())
|
||||
)
|
||||
)
|
||||
call_with.append(kwargs[parameter])
|
||||
return fn(*call_with)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue