@event(u'manager.before_config_validate')
def process_variables(config, manager):
 env_params = {u'block_start_string': u'^^disabled^^', u'block_end_string': u'^^disabled^^', u'variable_start_string': u'{?', u'variable_end_string': u'?}'}
 if ((u'variables' not in config) or (config.get(u'variables') is False)):
  return
 env = Environment(**env_params)
 if isinstance(config[u'variables'], bool):
  log.debug(u'trying to load variables from DB')
  variables = variables_from_db()
 else:
  log.debug(u'trying to load variables from file')
  variables = variables_from_file(manager.config_base, config[u'variables'])
  log.debug(u'updating DB with variable file contents')
  variables_to_db(variables)
 env.globals = variables
 _process(config, env)
 return config

@ event ( u'manager.before_config_validate' ) def process_variables ( config , manager ) : env_params = { u'block_start_string' : u'^^disabled^^' , u'block_end_string' : u'^^disabled^^' , u'variable_start_string' : u'{?' , u'variable_end_string' : u'?}' } if ( ( u'variables' not in config ) or ( config . get ( u'variables' ) is False ) ) : return env = Environment ( ** env_params ) if isinstance ( config [ u'variables' ] , bool ) : log . debug ( u'trying to load variables from DB' ) variables = variables_from_db ( ) else : log . debug ( u'trying to load variables from file' ) variables = variables_from_file ( manager . config_base , config [ u'variables' ] ) log . debug ( u'updating DB with variable file contents' ) variables_to_db ( variables ) env . globals = variables _process ( config , env ) return config
render all string elements of the config against defined variables .