def topic(self): os.environ['SOME_CONFIGURATION'] = "test value" config = Config() Config.allow_environment_variables() return config.SOME_CONFIGURATION
def topic(self): config = Config.load(fix('sample.conf')) Config.allow_environment_variables() try: os.environ['FOO'] = "baz" return config.FOO finally: del os.environ['FOO']
'21', 'Height of blur filter for input normalisation (must be odd)', 'Input') Config.define('MIN_CHANGE_THRESHOLD', '50', 'Pixel value change threshold for detection events', 'Detection') Config.define('MIN_CHANGE_AREA', '400', 'Minimum number of changed pixels for detection events', 'Detection') Config.define('OUTPUT_FPS', '5', 'Frames per second of output video', 'Output') Config.define('MAX_RECORDING_SECONDS', '20', 'Maximum number of seconds to record', 'Output') Config.allow_environment_variables() config = Config() def get(key): return config.get(key)
# 3rd Party from derpconf.config import Config Config.allow_environment_variables() Config.define( "DEBUG", False, "This configuration details if fastlane is running in debug mode.", "General", ) Config.define( "ENV", "production", "This configuration details the environment fastlane is running in.", "General", ) Config.define( "SECRET_KEY", "OTNDN0VCRDAtRTMyMS00NUM0LUFFQUYtNEI4QUE4RkFCRjUzCg==", """This configuration specifies the `SECRET_KEY` for Fastlane API. This should be unique per environment.""", "General", ) Config.define( "ENABLE_CORS", True, "This configuration enabled CORS headers in the API. CORS is enabled " "on '*' by default in Fastlane. It's the administrator's job to secure" " it behind some gateway.",