本文整理汇总了Python中pyramid.configuration.Configurator.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Configurator.__init__方法的具体用法?Python Configurator.__init__怎么用?Python Configurator.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyramid.configuration.Configurator
的用法示例。
在下文中一共展示了Configurator.__init__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyramid.configuration import Configurator [as 别名]
# 或者: from pyramid.configuration.Configurator import __init__ [as 别名]
def __init__(self,
registry=None,
package=None,
# Entity level services.
filter_specification_factory=None,
order_specification_factory=None,
# Application level services.
service=None,
cql_filter_specification_visitor=None,
sql_filter_specification_visitor=None,
eval_filter_specification_visitor=None,
cql_order_specification_visitor=None,
sql_order_specification_visitor=None,
eval_order_specification_visitor=None,
url_converter=None,
**kw
):
if package is None:
package = caller_package()
call_setup = registry is None
if call_setup:
# Need to initialize our registry here to call our setup_registry
# with the given custom option values rather than from the base
# class constructor.
# FIXME: There is some code duplication with Pyramid here.
name_resolver = DottedNameResolver(package)
name_resolver = name_resolver
package_name = name_resolver.get_package_name()
registry = Registry(package_name)
self.registry = registry
PyramidConfigurator.__init__(self,
registry=registry, package=package, **kw)
# Set up configurator's load_zcml method.
self.add_directive('load_zcml', load_zcml, action_wrap=False)
if call_setup:
self.setup_registry(
filter_specification_factory=filter_specification_factory,
order_specification_factory=order_specification_factory,
service=service,
cql_filter_specification_visitor=
cql_filter_specification_visitor,
sql_filter_specification_visitor=
sql_filter_specification_visitor,
eval_filter_specification_visitor=
eval_filter_specification_visitor,
cql_order_specification_visitor=
cql_order_specification_visitor,
sql_order_specification_visitor=
sql_order_specification_visitor,
eval_order_specification_visitor=
eval_order_specification_visitor,
url_converter=url_converter,
**kw)