Right, but hardcoding the img_dir in my dev.cfg will not make this
portable on windows. Is there a way to construct the path in the
dev.cfg using os.path.join etc.. and then storing that in img_dir and
then using it everywhere?
Also, if I run my batch tool outside of the turbogears environment
(independently), I need to know the package name. How do I get this
when I run the batch tool? resource_filename says it doesn't know the
package name but when I start tg-admin shell, it does? Argh,
turbogears is starting to become a liability.
sam.
On Jun 12, 12:20 am, SamDonaldson <[EMAIL PROTECTED]> wrote:
> Right, but hardcoding the img_dir in my dev.cfg will not make this
> portable on windows. Is there a way to construct the path in the
> dev.cfg using os.path.join etc.. and then storing that in img_dir and
> then using it everywhere?
>
> sam.
>
> On Jun 11, 2:10 am, Christopher Arndt <[EMAIL PROTECTED]> wrote:
>
> > SamDonaldson schrieb:
>
> > > I'd like to be able to set some global server variables such as my
> > > package path so that it's easily accessible from anywhere in my code.
> > > I'd like to be able to store a path to my images directory etc.. How
> > > do I do this. I'm trying to set a variable in my dev.cfg but I can't
> > > see that variable name in any of my controller or model files etc..
>
> > ---- app.cfg ----
> > [global]
> > ...
> > img_dir = "%(top_level_dir)s/static/images"
> > ...
> > ---- end ----
>
> > import turbogears
> > img_dir = turbogears.config.get('img_dir', '/default/image/path')
>
> > Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---