+

:4736 Function create_function() is deprecated [8192]

Last commit for mycoserver/configuration.py: 7004713412b51ec58cf01149ba736fadf769acaf

Initial commit

Benjamin Renard [2014-01-12 00:33:07]
Initial commit
  1. # -*- coding: utf-8 -*-
  2.  
  3.  
  4. """Paste INI configuration"""
  5.  
  6.  
  7. import os
  8.  
  9. from biryani1 import strings
  10. from biryani1.baseconv import (check, default, guess_bool, pipe, struct)
  11.  
  12.  
  13. def load_configuration(global_conf, app_conf):
  14. """Build the application configuration dict."""
  15. app_dir = os.path.dirname(os.path.abspath(__file__))
  16. conf = {}
  17. conf.update(strings.deep_decode(global_conf))
  18. conf.update(strings.deep_decode(app_conf))
  19. conf.update(check(struct(
  20. {
  21. 'app_conf': default(app_conf),
  22. 'app_dir': default(app_dir),
  23. 'cache_dir': default(os.path.join(os.path.dirname(app_dir), 'cache')),
  24. 'debug': pipe(guess_bool, default(False)),
  25. 'global_conf': default(global_conf),
  26. },
  27. default='drop',
  28. drop_none_values=False,
  29. ))(conf))
  30. return conf