For sure.  I started digging around config.introspector and found that 
config.introspector.get_category('views’) gives me a list of dictionaries 
describing all the views, including the callable and the context like I wanted.

I was also able to hack together something to construct URLs from that:  
https://gist.github.com/luhn/f56873c758ae07e59d7b50db197d1751 
<https://gist.github.com/luhn/f56873c758ae07e59d7b50db197d1751>

— Theron



> On Mar 7, 2017, at 1:30 AM, Mikko Ohtamaa <[email protected]> wrote:
> 
> Hi Theron,
> 
> Can you share your art when you figure out it? E.g. a link to Gist on Github. 
> I feel this would be beneficial to record it down in cookbook for everbody.
> 
> Best regards,
> Mikko
> 
> On 7 March 2017 at 09:00, Theron Luhn <[email protected] 
> <mailto:[email protected]>> wrote:
> Thanks!  That pushed me in the right direction, I think I have it figured out 
> now.
> 
> — Theron
> 
> 
> 
>> On Feb 23, 2017, at 12:13 AM, Mikko Ohtamaa <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> Hey Theron,
>> 
>> 
>> One thing I can't figure out is how to extract the view callables from 
>> Pyramid (since I need them for the docstrings).  Is there someway I can get 
>> a list of the view callables and the associated resource?  Or perhaps given 
>> a resource, iterate through all associated view callables?
>> 
>> I am not sure if this helps, but I recursively traverse all site resources 
>> and views for a sitemap:
>> 
>> https://github.com/websauna/websauna/blob/master/websauna/system/core/sitemap.py#L316
>>  
>> <https://github.com/websauna/websauna/blob/master/websauna/system/core/sitemap.py#L316>
>> 
>> It's easy to get views for a given resource context object. You can probably 
>> query all views for any context object directly from the underlying Zope 
>> component registry.
>>  
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "pylons-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] 
>> <mailto:[email protected]>.
>> To post to this group, send email to [email protected] 
>> <mailto:[email protected]>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pylons-discuss/916cf024-e60e-4463-9d91-a791701c9c0d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/pylons-discuss/916cf024-e60e-4463-9d91-a791701c9c0d%40googlegroups.com?utm_medium=email&utm_source=footer>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
>> 
>> 
>> 
>> -- 
>> Mikko Ohtamaa
>> http://opensourcehacker.com <http://opensourcehacker.com/>
>> http://twitter.com/moo9000 <http://twitter.com/moo9000>
>> 
>> 
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "pylons-discuss" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/pylons-discuss/PokpluvF688/unsubscribe 
>> <https://groups.google.com/d/topic/pylons-discuss/PokpluvF688/unsubscribe>.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] 
>> <mailto:[email protected]>.
>> To post to this group, send email to [email protected] 
>> <mailto:[email protected]>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pylons-discuss/CAK8RCUtWcORQm2BJoa-bB4ZNXkousezutM4xFLY7Yoq6hZyCdw%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/pylons-discuss/CAK8RCUtWcORQm2BJoa-bB4ZNXkousezutM4xFLY7Yoq6hZyCdw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pylons-discuss/FEC0E52A-A7AD-4274-8AF5-9D96441D5982%40luhn.com
>  
> <https://groups.google.com/d/msgid/pylons-discuss/FEC0E52A-A7AD-4274-8AF5-9D96441D5982%40luhn.com?utm_medium=email&utm_source=footer>.
> 
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.
> 
> 
> 
> -- 
> Mikko Ohtamaa
> http://opensourcehacker.com <http://opensourcehacker.com/>
> http://twitter.com/moo9000 <http://twitter.com/moo9000>
> 
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "pylons-discuss" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/pylons-discuss/PokpluvF688/unsubscribe 
> <https://groups.google.com/d/topic/pylons-discuss/PokpluvF688/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pylons-discuss/CAK8RCUvk%3DYbgXAb_iyC9YNyRji_s69jwDq2HUxu%2Bc3MPp6nYqw%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/pylons-discuss/CAK8RCUvk%3DYbgXAb_iyC9YNyRji_s69jwDq2HUxu%2Bc3MPp6nYqw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/ABF9AA9E-0DC1-4834-AA8D-3A0CDF71BD9B%40luhn.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to