Thanks Marco,
First let me apologize for the repeat posts... not sure why that's
happening but it's not intentional.
I implemented your second option and it works great.
my dev.cfg:
proxy.on=True
proxy.url="myproxy"
proxy.port=1234
Then throughout the .py code when I need proxy service:
from turbogears import config
u = OutsideWorld() #where OutsideWorld is an object that require proxy
info to get outside and do stuff
if config.get('proxy.on', True):
proxy = config.get('proxy.on')
url = config.get('proxy.url')
port = config.get('proxy.port')
u.proxy = proxy
u.proxyurl = url
u.proxyport = port
That's about it I think.
Thanks again all of you!
-Bishop
On Mar 2, 8:34 am, Marco Mariani <[EMAIL PROTECTED]> wrote:
> Steve wrote:
> > And this all works fine, I was just looking for perhaps a prettier way
> > to let the entire application know whether it needed to the use the
> > proxy (because it's a development environment) or not (prod.) without
> > having to edit too much code between environments.
>
> from turbogears import config
>
> if config.get('server.environment') == 'development':
> bla bla..
>
> Actually, I would put this, in dev.cfg:
>
> proxy.on = True
> proxy.url = '...'
> proxy.port = '...'
>
> and then
>
> if config.get('proxy.on',False):
> bla bla...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---