Hi all,
with its paster command "pviews" Pyramid offers a nice way to check the view callables that can be reached by a certain URL. Now, I'd like to go the other way round, that is list *all* registered views and display their attributes like name, permission etc. So I get not lost in details and code ;)
After having analysed the pviews command and read more about ZCA than I ever wanted to ask (but now that I know about Adapters and Utilities and such, I ask myself how I could've lived without it), I came up with a
little script that:
- collects all registered views
- lists them grouped by their module
- shows detailed info like pviews
Ok, I borrowed much from the pviews command, and some subjects are still unclear for me. The questions are in the code.
One question I'd like to ask here is, given a view adapter queried from the registry, and also the corresponding view callable, is it possible to determine the context that was defined for the view (e.g. as @view_config(context="Foo")). With such context and the traversal functions, I could also list the URL path that invokes each view.
Some more notes and the code to download you'll find here:
Maybe someone finds this useful, too.
Thanks,
Dirk