sontek/pyramid_webassets — Issue #1: Support all settings
Author: miracle2k
Created: 2012-01-09 11:52:12+00:00
State: open

Thanks for writing this! I love seeing wider framework support for webassets.

One thing I noticed: It seems like you currently are only supporting a select number of settings, which would mean that other filter's settings (SASS_BIN etc). would not be supported. There is actually a way to support settings in a generic manner: You can create the webassets Environment with a custom config_storage_class attribute. It's a relatively simple class that would wrap the Pyramid settings object.

If you look at how the Django wrapper does this:

https://github.com/miracle2k/flask-assets/blob/master/src/flaskext/assets.py

It goes through the extra effort of only using a prefix for the core settings, but not for any that filters might use, i.e. within Django, it would be ASSETS_UPDATER, but SASS_BIN, but that might or might not be appropriate for Pyramid.

By wrapping the settings in a generic fashion, you also gain better upwards-compatibility. For example, the "updater" setting will likely be replaced with one called "auto_build" in the future.