def __init__(self, app_config, options): for opt in options.keys(): if isinstance(options[opt], basestring): options[opt] = replace_params(options[opt], app_config) self.config = app_config self.options = options
def get_value(self, value, session): value = replace_params(value, self.config) return value.format(**session.credentials())