def setup(): config['global'].update({ 'environment': 'test_suite', }) config['app'].update({ 'log_level': 'ERROR', }) app.setup() app.mount() cherrypy.server.unsubscribe() cherrypy.engine.start()
"""SuttaCentral server environment. Usage: cherryd -i sc.server Note: This module is not intended to be imported from another module or program. """ from sc import app, updater app.setup() app.mount()
""" import logging logger = logging.getLogger(__name__) def _green_text(text): try: from colorama import Fore return Fore.GREEN + text + Fore.RESET except ImportError: return text try: from sc import app, config app.setup() app.mount() except ImportError as e: logger.exception(e) cmd = 'pip install -r requirements.txt' logger.error('Missing dependency, try running: {}'.format(_green_text(cmd))) exit(1) def run_interactive(): """The same as cherrypy.quickstart, but don't block.""" from cherrypy import engine # This is what quickstart does but we don't block engine.signals.subscribe() engine.start() #engine.block()