コード例 #1
0
def main():
    args = getArgs()
    params = getParameters(args)
    sys.argv = [sys.argv[0]]
    conf = service.prepareService()
    payloads = generatePayloads(**params)
    sendMessage(payloads=payloads, conf=conf)
コード例 #2
0
ファイル: app.py プロジェクト: machao19902/myproject
def build_wsgi_app():
    print "######### enter build_wsgi_app"
    conf = service.prepareService()
    uri = getUri(conf)
    appName = getAppName()
    app = deploy.loadapp(uri, name=appName)
    return app
コード例 #3
0
ファイル: app.py プロジェクト: machao19902/myproject
def app_factory(global_config, **local_config):
    print "######### enter app_factory"
    conf = service.prepareService()

    # NOTE, add config and databse information to the request
    # by using pecan.hooks.PecanHook
    configHook = hooks.ConfigHook(conf)
    conn = db.getConnectionFromConfig(conf)
    databaseHook = hooks.DatabaseHook(conn)
    appHooks = [configHook, databaseHook]

    # NOTE, it needs add the line below
    pecan.configuration.set_config(dict(PECAN_CONFIG), overwrite=True)
    app = pecan.make_app(PECAN_CONFIG['app']['root'], hooks=appHooks)
    return app
コード例 #4
0
def dbsync():
    conf = service.prepareService()
    db.getConnectionFromConfig(conf).upgrade()
コード例 #5
0
def main():
    conf = service.prepareService()
    sm = cotyledon.ServiceManager()
    sm.add(sky.SkyService, workers=conf.sky.workers, args=(conf,))
    sm.run()
コード例 #6
0
def pollingd():
    # initialize config
    conf = service.prepareService()
    PollingServiceManager(conf).run()