On Wednesday, September 7, 2011 9:52:27 AM UTC-7, Michael Merickel wrote:
>
> Apologies for not following most of the conversation, but just thought I'd 
> mention that in the past I've done:
>
> def main(global_conf, **app_settings):
>     settings = global_conf.copy()
>     settings.update(app_settings)
>
> Which allows you to override settings in your app if you want while still 
> specifying common setup in [DEFAULT].
>
> Pyramid just uses PasteDeploy to parse the INI file, so any 'set' semantics 
> will still work. Since the settings are not combined by Pyramid, however, I 
> don't think you will gain much by using 'set' over the code I showed above.
>

FWIW, I do basically the same thing. I forgot that I'm doing that, because I 
moved my settings initialization code out of `main`.

With regard to `set`, don't you *have* use it if you want to override a 
global setting in your app config? It looks like[1] if a config key is 
present in both the global config and an app section, the setting in the app 
section is ignored unless you use `set`. This seems counterintuitive to me.

https://bitbucket.org/ianb/pastedeploy/src/8803df83ca09/paste/deploy/loadwsgi.py#cl-428

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pylons-discuss/-/goYqqff52UcJ.
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