Brubeck() takes **kwargs but key, value isn't stored in brubeck object, storing the key, value is useful for third party libraries.
Example:
config = {
'msg_conn': WSGIConnection(),
'template_loader': load_jinja2_env('./../demos/templates'),
'cookie_secret': 'OMGSOOOOOSECRET',
'assets': {
'directory': './../assets',
'debug': True,
}
}
# Instantiate app instance
b_app = Brubeck(**config)
app = SimpleURL(b_app)
from brubeck_utils.assets import Environment
assets = Environment(app)
right now I need to access brubeck configuration values as well, one way to get around this is.
assets = Environment(app, config['assests']) or assets = Environment(config).
Currently brubeck doesn't have config object which can used by third party modules.
There are two ways to fix:
- Add
config dict which stores all configuration details passed during object creation, so that third party libraries can access it. EG: I can place my CAPTCHA_SECRET, OAUTH_SECRET in config dict or python file.
- Assign
kwargs key, value during object creation.
for key, value in kwargs.items():
setattr(self, key, value)
Method 1 is preferred.
I will be happy to submit the patch, if accepted.
Brubeck()takes**kwargsbut key, value isn't stored in brubeck object, storing the key, value is useful for third party libraries.Example:
right now I need to access brubeck configuration values as well, one way to get around this is.
assets = Environment(app, config['assests'])orassets = Environment(config).Currently brubeck doesn't have
configobject which can used by third party modules.There are two ways to fix:
configdict which stores all configuration details passed during object creation, so that third party libraries can access it. EG: I can place myCAPTCHA_SECRET, OAUTH_SECRET in config dict or python file.kwargs key, valueduring object creation.Method 1is preferred.I will be happy to submit the patch, if accepted.