# -*- python -*- """WSGI entry point""" import logging import logging.config log = logging.getLogger() logging.basicConfig(level=logging.INFO) from selector import Selector import calliope.config as config logging.config.fileConfig("/etc/calliope/logging.conf") # Logger configs are *not* retroactive. This should happen as early as possible. import calliope.muddleware as muddleware import calliope.db # No symbols used here, but importing it does some essential set-up # Create the mapper object: the core decision-maker mapper = Selector() # Middleware called in this order, before the mapper application = muddleware.ExceptionHandler(mapper) # Wrappers defined with mapper.wrap are called after the selector (in # the order they appear here). mapper.wrap = muddleware.JSONWrapper if "recorder" in config.components: log.info("Starting recorder") import calliope.recorder as recorder recorder.setup(mapper) log.info("Recorder started") if "organ" in config.components: log.info("Starting organ") import calliope.organ as organ organ.setup(mapper) log.info("Organ started") if "panpipe" in config.components: log.info("Starting panpipe") import calliope.panpipe as panpipe panpipe.setup(mapper) log.info("Panpipe started")