def __init__(self, app, local_conf):
<EOL>self.app = app<EOL>self.limits = []<EOL>self.limit_sum = None<EOL>self.mapper = None<EOL>self.mapper_lock = eventlet.semaphore.Semaphore()<EOL>self.conf = config.Config(conf_dict=local_conf)<EOL>self._db = None<EOL>self.preprocessors = []<EOL>self.postprocessors = []<EOL>enable = self.conf.get('<STR_LIT>')<EOL>if enable is not None:<EOL><INDENT>for proc in enable.split():<EOL><INDENT>preproc = utils.find_entrypoint('<STR_LIT>',<EOL>proc, compat=False)<EOL>if preproc:<EOL><INDENT>self.preprocessors.append(preproc)<EOL><DEDENT>postproc = utils.find_entrypoint('<STR_LIT>',<EOL>proc, compat=False)<EOL>if postproc:<EOL><INDENT>self.postprocessors.insert(<NUM_LIT:0>, postproc)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for preproc in self.conf.get('<STR_LIT>', '<STR_LIT>').split():<EOL><INDENT>klass = utils.find_entrypoint('<STR_LIT>',<EOL>preproc, required=True)<EOL>self.preprocessors.append(klass)<EOL><DEDENT>for postproc in self.conf.get('<STR_LIT>', '<STR_LIT>').split():<EOL><INDENT>klass = utils.find_entrypoint('<STR_LIT>',<EOL>postproc, required=True)<EOL>self.postprocessors.append(klass)<EOL><DEDENT><DEDENT>formatter = self.conf.get('<STR_LIT>')<EOL>if formatter:<EOL><INDENT>formatter = utils.find_entrypoint('<STR_LIT>',<EOL>formatter, required=True)<EOL>self.formatter = lambda a, b, c, d, e: formatter(<EOL>self.conf.status, a, b, c, d, e)<EOL><DEDENT>else:<EOL><INDENT>self.formatter = self.format_delay<EOL><DEDENT>if self.conf.to_bool(self.conf['<STR_LIT>'].get('<STR_LIT>', '<STR_LIT>'), False):<EOL><INDENT>self.control_daemon = remote.RemoteControlDaemon(self, self.conf)<EOL><DEDENT>else:<EOL><INDENT>self.control_daemon = control.ControlDaemon(self, self.conf)<EOL><DEDENT>self.control_daemon.start()<EOL>LOG.info("<STR_LIT>")<EOL>
Initialize the turnstile middleware.  Saves the configuration
and sets up the list of preprocessors, connects to the
database, and initiates the control daemon thread.