Well I can do this:

def main(global_config, **settings):
    settings.update((key, val) for key, val in global_config.items()
if key not in settings)


...which means that this would work:


[DEFAULT]
x = 1

[app:app1]
#inherits x
x = my x #overrides x


But if PasteDeploy already supports this with the "set" keyword, can't
we access that functionality somehow? Does pyramid bypass it and parse
the file on its own?


On Sep 1, 4:36 pm, Wyatt Baldwin <wyatt.lee.bald...@gmail.com> wrote:
> It should work the same way in Pyramid or Pylons, since they both use
> PasteDeploy to parse and interpret the config file. My config looks
> something like this:
>
> [DEFAULT]
> x = 1
>
> [app:app1]
> use = egg:MyEgg
> # this should "inherit" x
> # If you want to override the global x, you have to use `set` (which is a
> PasteDeploy thing and is what makes it behave differently from native
> ConfigParser):
> set x = my x
>
> [app:app2]
> use = egg:AnotherEgg
> # this should also inherit x

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

Reply via email to