cubicweb/cwconfig.py
changeset 11476 a9f26de5ea6c
parent 11472 bc04039acd2e
child 11681 b23d58050076
equal deleted inserted replaced
11475:d2fcd81b7ca9 11476:a9f26de5ea6c
   204 from logilab.common.configuration import (Configuration, Method,
   204 from logilab.common.configuration import (Configuration, Method,
   205                                           ConfigurationMixIn, merge_options)
   205                                           ConfigurationMixIn, merge_options)
   206 
   206 
   207 from cubicweb import (CW_SOFTWARE_ROOT, CW_MIGRATION_MAP,
   207 from cubicweb import (CW_SOFTWARE_ROOT, CW_MIGRATION_MAP,
   208                       ConfigurationError, Binary, _)
   208                       ConfigurationError, Binary, _)
   209 from cubicweb.toolsutils import create_dir
   209 from cubicweb.toolsutils import create_dir, option_value_from_env
   210 
   210 
   211 CONFIGURATIONS = []
   211 CONFIGURATIONS = []
   212 
   212 
   213 SMTP_LOCK = Lock()
   213 SMTP_LOCK = Lock()
   214 
   214 
   414           'help': "don't display actual email addresses but mangle them if \
   414           'help': "don't display actual email addresses but mangle them if \
   415 this option is set to yes",
   415 this option is set to yes",
   416           'group': 'email', 'level': 3,
   416           'group': 'email', 'level': 3,
   417           }),
   417           }),
   418         )
   418         )
       
   419 
       
   420     def __getitem__(self, key):
       
   421         """Get configuration option, by first looking at environmnent."""
       
   422         file_value = super(CubicWebNoAppConfiguration, self).__getitem__(key)
       
   423         return option_value_from_env(key, file_value)
       
   424 
   419     # static and class methods used to get instance independant resources ##
   425     # static and class methods used to get instance independant resources ##
   420     @staticmethod
   426     @staticmethod
   421     def cubicweb_version():
   427     def cubicweb_version():
   422         """return installed cubicweb version"""
   428         """return installed cubicweb version"""
   423         from logilab.common.changelog import Version
   429         from logilab.common.changelog import Version