本文整理汇总了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)
示例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)