当前位置: 首页>>代码示例>>Python>>正文


Python Settings.object_from方法代码示例

本文整理汇总了Python中frontera.settings.Settings.object_from方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.object_from方法的具体用法?Python Settings.object_from怎么用?Python Settings.object_from使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在frontera.settings.Settings的用法示例。


在下文中一共展示了Settings.object_from方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: from_settings

# 需要导入模块: from frontera.settings import Settings [as 别名]
# 或者: from frontera.settings.Settings import object_from [as 别名]
 def from_settings(cls,
                   settings=None,
                   db_worker=False,
                   strategy_worker=False):
     """
     Returns a :class:`FrontierManager <frontera.core.manager.FrontierManager>`  instance initialized with \
     the passed settings argument. If no settings is given,
     :ref:`frontier default settings <frontier-default-settings>` are used.
     """
     manager_settings = Settings.object_from(settings)
     return FrontierManager(
         request_model=manager_settings.REQUEST_MODEL,
         response_model=manager_settings.RESPONSE_MODEL,
         backend=manager_settings.BACKEND,
         logger=manager_settings.LOGGER,
         event_log_manager=manager_settings.EVENT_LOG_MANAGER,
         middlewares=manager_settings.MIDDLEWARES,
         test_mode=manager_settings.TEST_MODE,
         max_requests=manager_settings.MAX_REQUESTS,
         max_next_requests=manager_settings.MAX_NEXT_REQUESTS,
         auto_start=manager_settings.AUTO_START,
         settings=manager_settings,
         canonicalsolver=manager_settings.CANONICAL_SOLVER,
         db_worker=db_worker,
         strategy_worker=strategy_worker)
开发者ID:wpxgit,项目名称:frontera,代码行数:27,代码来源:manager.py

示例2: from_settings

# 需要导入模块: from frontera.settings import Settings [as 别名]
# 或者: from frontera.settings.Settings import object_from [as 别名]
 def from_settings(cls, settings=None):
     settings = Settings.object_from(settings)
     return FakeFrontierManager(settings)
开发者ID:Preetwinder,项目名称:frontera,代码行数:5,代码来源:frontier_manager.py


注:本文中的frontera.settings.Settings.object_from方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。