當前位置: 首頁>>代碼示例>>Python>>正文


Python Router.info方法代碼示例

本文整理匯總了Python中router.Router.info方法的典型用法代碼示例。如果您正苦於以下問題:Python Router.info方法的具體用法?Python Router.info怎麽用?Python Router.info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在router.Router的用法示例。


在下文中一共展示了Router.info方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: start

# 需要導入模塊: from router import Router [as 別名]
# 或者: from router.Router import info [as 別名]
def start (args):
    
    # if a specific conf has been provided (which it
    # will be), if we're inside the django reloaded
    if "RAPIDSMS_INI" in os.environ:
        ini = os.environ["RAPIDSMS_INI"]
    
    # use a local ini (for development)
    # if one exists, to avoid everyone
    # having their own rapidsms.ini
    elif os.path.isfile("local.ini"):
        ini = "local.ini"
    
    # otherwise, fall back
    else: ini = "rapidsms.ini"


    # add the ini path to the environment, so we can
    # access it globally, including any subprocesses
    # spawned by django
    os.environ["RAPIDSMS_INI"] = ini

    # read the config, which is shared
    # between the back and frontend
    conf = Config(ini)
    
    # import the webui settings, which builds the django
    # config from rapidsms.config, in a round-about way.
    # can't do it until env[RAPIDSMS_INI] is defined
    from rapidsms.webui import settings

    # whatever we're doing, we'll need to call
    # django's setup_environ, to configure the ORM
    os.environ["DJANGO_SETTINGS_MODULE"] = "rapidsms.webui.settings"
    from django.core.management import setup_environ, execute_manager
    setup_environ(settings)

    # if one or more arguments were passed, we're
    # starting up django -- copied from manage.py
    if len(args) > 1:
        execute_manager(settings)
    
    # no arguments passed, so perform
    # the default action: START RAPIDSMS
    else:
        router = Router()
        router.set_logger(conf["log"]["level"], conf["log"]["file"])
        router.info("RapidSMS Server started up")
        
        # add each application from conf
        for app_conf in conf["rapidsms"]["apps"]:
            router.add_app(app_conf)

        # add each backend from conf
        for backend_conf in conf["rapidsms"]["backends"]:
            router.add_backend(backend_conf)

        # wait for incoming messages
        router.start()
開發者ID:jjackson,項目名稱:rapidsms,代碼行數:61,代碼來源:manager.py

示例2: route

# 需要導入模塊: from router import Router [as 別名]
# 或者: from router.Router import info [as 別名]
    def route (self, conf, *args):
        router = Router()
        router.set_logger(conf["log"]["level"], conf["log"]["file"])
        router.info("RapidSMS Server started up")
        
        # add each application from conf
        for app_conf in conf["rapidsms"]["apps"]:
            router.add_app(app_conf)

        # add each backend from conf
        for backend_conf in conf["rapidsms"]["backends"]:
            router.add_backend(backend_conf)

        # wait for incoming messages
        router.start()
開發者ID:lengani,項目名稱:rapidsms_legacy,代碼行數:17,代碼來源:manager.py

示例3: route

# 需要導入模塊: from router import Router [as 別名]
# 或者: from router.Router import info [as 別名]
    def route (self, conf, *args):
        router = Router()
        router.set_logger(conf["log"]["level"], conf["log"]["file"])
        router.info("RapidSMS Server started up")
        
        # add each application from conf
        for app_conf in conf["rapidsms"]["apps"]:
            router.add_app(app_conf)

        # add each backend from conf
        for backend_conf in conf["rapidsms"]["backends"]:
            router.add_backend(backend_conf)

        # wait for incoming messages
        router.start()
        
        # TODO: Had to explicitly do this to end the script. Will need a fix.
        sys.exit(0)
開發者ID:damilare,項目名稱:rapidsms-borno,代碼行數:20,代碼來源:manager.py

示例4: route

# 需要導入模塊: from router import Router [as 別名]
# 或者: from router.Router import info [as 別名]
    def route (self, conf, *args):
        router = Router()
        router.set_logger(conf["log"]["level"], conf["log"]["file"])
        router.info("RapidSMS Server started up")

        # even though we have the original rapidsms conf, iterate
        # the running apps through the django settings, since app
        # dependencies will be managed there (by depends.py). also,
        # i'm trying to ignore the .ini file so hard that it dies
        from rapidsms.djangoproject.settings import RAPIDSMS_APPS, RAPIDSMS_BACKENDS

        # add each application from conf
        for app_conf in RAPIDSMS_APPS.values():
            router.add_app(app_conf)

        # add each backend from conf
        for backend_conf in RAPIDSMS_BACKENDS.values():
            router.add_backend(backend_conf)

        # wait for incoming messages
        router.start()
開發者ID:oluka,項目名稱:mapping_rapidsms,代碼行數:23,代碼來源:manager.py


注:本文中的router.Router.info方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。