Introspection of translation directories

13 views
Skip to first unread message

Daniele Paolella

unread,
Mar 21, 2012, 1:27:08 PM3/21/12
to pylons-...@googlegroups.com
I need to get the absolute path of configured translation directories in a Pyramid 1.3 app.
Something like
registry.introspector.get_category('translation directories')[0]['introspectable']['directory']
works fine in the pshell, and suppose inside a view too.
But what if I want that value inside the main function, just after calling config.add_translation_dirs?
It looks like config.registry.introspector doesn't hold such category yet.

Chris McDonough

unread,
Mar 21, 2012, 1:32:05 PM3/21/12
to pylons-...@googlegroups.com

You need to call config.commit() before trying to get a hold of
introspection values. (make_wsgi_app does this implicitly)

>
> --
> You received this message because you are subscribed to the Google
> Groups "pylons-discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pylons-discuss/-/iUW-E235uVYJ.
> To post to this group, send email to pylons-...@googlegroups.com.
> To unsubscribe from this group, send email to pylons-discuss
> +unsub...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.


Daniele Paolella

unread,
Mar 21, 2012, 2:36:32 PM3/21/12
to pylons-...@googlegroups.com
Fair enough, thank you.


Il giorno mercoledì 21 marzo 2012 18:32:05 UTC+1, Chris McDonough ha scritto:
On Wed, 2012-03-21 at 10:27 -0700, Daniele Paolella wrote:
> I need to get the absolute path of configured translation directories
> in a Pyramid 1.3 app.
> Something like
> registry.introspector.get_category('translation
> directories')[0]['introspectable']['directory']
>
> works fine in the pshell, and suppose inside a view too.
> But what if I want that value inside the main function, just after
> calling config.add_translation_dirs?
> It looks like config.registry.introspector doesn't hold such category
> yet.
>

You need to call config.commit() before trying to get a hold of
introspection values.  (make_wsgi_app does this implicitly)

>
> --
> You received this message because you are subscribed to the Google
> Groups "pylons-discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pylons-discuss/-/iUW-E235uVYJ.

> To post to this group, send email to pylons-discuss@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages