@task
@cmdopts([BOKCHOY_COVERAGERC, BOKCHOY_DEFAULT_STORE, BOKCHOY_DEFAULT_STORE_DEPR])
@timed
def start_servers(options):
 coveragerc = options.get('coveragerc', Env.BOK_CHOY_COVERAGERC)
 def start_server(cmd, logfile, cwd=None):
  '\n        Starts a single server.\n        '
  print cmd, logfile
  run_background_process(cmd, out_log=logfile, err_log=logfile, cwd=cwd)
 for (service, info) in Env.BOK_CHOY_SERVERS.iteritems():
  address = '0.0.0.0:{}'.format(info['port'])
  cmd = 'DEFAULT_STORE={default_store} coverage run --rcfile={coveragerc} -m manage {service} --settings bok_choy runserver {address} --traceback --noreload'.format(default_store=options.default_store, coveragerc=coveragerc, service=service, address=address)
  start_server(cmd, info['log'])
 for (service, info) in Env.BOK_CHOY_STUBS.iteritems():
  cmd = 'python -m stubs.start {service} {port} {config}'.format(service=service, port=info['port'], config=info.get('config', ''))
  start_server(cmd, info['log'], cwd=Env.BOK_CHOY_STUB_DIR)

@ task @ cmdopts ( [ BOKCHOY_COVERAGERC , BOKCHOY_DEFAULT_STORE , BOKCHOY_DEFAULT_STORE_DEPR ] ) @ timed def start_servers ( options ) : coveragerc = options . get ( 'coveragerc' , Env . BOK_CHOY_COVERAGERC ) def start_server ( cmd , logfile , cwd = None ) : print cmd , logfile run_background_process ( cmd , out_log = logfile , err_log = logfile , cwd = cwd ) for ( service , info ) in Env . BOK_CHOY_SERVERS . iteritems ( ) : address = '0.0.0.0:{}' . format ( info [ 'port' ] ) cmd = 'DEFAULT_STORE={default_store} coverage run --rcfile={coveragerc} -m manage {service} --settings bok_choy runserver {address} --traceback --noreload' . format ( default_store = options . default_store , coveragerc = coveragerc , service = service , address = address ) start_server ( cmd , info [ 'log' ] ) for ( service , info ) in Env . BOK_CHOY_STUBS . iteritems ( ) : cmd = 'python -m stubs.start {service} {port} {config}' . format ( service = service , port = info [ 'port' ] , config = info . get ( 'config' , '' ) ) start_server ( cmd , info [ 'log' ] , cwd = Env . BOK_CHOY_STUB_DIR )
start the servers we will run tests on .