datasette / datasette-debug-permissions

A Datasette plugin that outputs debug information about permission checks
Apache License 2.0
1 stars 0 forks source link

Try using a wrapper=True hook for this #3

Open simonw opened 1 year ago

simonw commented 1 year ago

https://pluggy.readthedocs.io/en/stable/#wrappers

A hookimpl can be marked with the "wrapper" option, which indicates that the function will be called to wrap (or surround) all other normal hookimpl calls. A hook wrapper can thus execute some code ahead and after the execution of all corresponding non-wrappper hookimpls.

Could this result in better debug information? Currently this plugin does this:

https://github.com/datasette/datasette-debug-permissions/blob/fba9dd0bb213925f2b1724568034303408fe519b/datasette_debug_permissions.py#L10-L13