On 12/3/06, Elvelind Grandin <[EMAIL PROTECTED]> wrote:
>
> All Tools in the toolbox including the webconsole only gets those
> things it needs from the config (which basicly is dburi). This is so
> settings in the config don't break the toolbox.
Understood, but it is confusing to issue
import turbogears
print turbogears.config.get('foo.bar')
and not get what you expect nor an error. It throws no errors or
warnings, it just returns None. If it can't find the .cfg file it
show throw an error, if it won't allow those settings to be read to
protect itself it should throw an error. Seems to be breaking PEP-20
http://www.python.org/dev/peps/pep-0020/
"Errors should never pass silently. Unless explicitly silenced."
After reading through the code -- here is what needed to be done to
read values in a cfg file in Webconsole:
>>> import turbogears
>>> turbogears.config.update_config(configfile="prod.cfg",modulename="foo.config")
>>> print turbogears.config.get('foo.bar')
baz
-jeff
> On 12/2/06, Jeff Hinrichs - DM&T <[EMAIL PROTECTED]> wrote:
> >
> > On 12/2/06, Karl Guertin <[EMAIL PROTECTED]> wrote:
> > >
> > > On 12/2/06, Jeff Hinrichs - DM&T <[EMAIL PROTECTED]> wrote:
> > > > I just tried putting the setting(foo.bar = "baz") in the [global]
> > > > section of dev.cfg, restarted the toolbox and it is not finding the
> > >
> > > That's kind of odd, I've done app-specific settings in projects and
> > > never had an issue with not being able to access them. You might try
> > > using something besides foo in case that's being used, but I don't see
> > > a problem with the code.
> > >
> >
> > I can find it with code in controllers.py but not from the WebConsole.
> > It seems webconsole is kind of a fizzle - I was hoping to have some
> > introspection into the project code but it seems to be focused on the
> > database.
> >
> > Thanks for responding!
> >
> > -Jeff
> >
> > >
> >
>
>
> --
> cheers
> elvelind grandin
>
> >
>
--
Jeff Hinrichs
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---