Application config

View: New views
4 Messages — Rating Filter:   Alert me  

Application config

by Kristaps Bulins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Can somebody show how tu access application config outside the request
process ?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Application config

by Robert Brewer-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Kristaps Bulins wrote:
> Can somebody show how to access application config outside the request
> process ?

app = cherrypy.tree.mount(Root(), '/apps/mine', conf)
print app.config['/path']['hello']

...or...

print cherrypy.tree.apps['/apps/mine']['/path']['hello']


Robert Brewer
fumanchu@...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Application config

by Kristaps Bulins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


First example works fine but other no. I got
app = cherrypy.tree.mount(SApplication(), '/', "App.conf")
print cherrypy.tree.apps['/']
and get KeyError['/']


On 20 sept., 20:29, "Robert Brewer" <fuman...@...> wrote:

> Kristaps Bulins wrote:
> > Can somebody show how to access application config outside the request
> > process ?
>
> app = cherrypy.tree.mount(Root(), '/apps/mine', conf)
> print app.config['/path']['hello']
>
> ...or...
>
> print cherrypy.tree.apps['/apps/mine']['/path']['hello']
>
> Robert Brewer
> fuman...@...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Application config

by Kristaps Bulins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I edited code and get it work like this
app = cherrypy.tree.mount(SApplication(), '/', "App.conf")
print cherrypy.tree.apps[''] .config['section']
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---