Пример #1
0
 def __init__(self,
              registry=None,
              package=None,
              autocommit=True,
              # 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)
         package_name = name_resolver.get_package_name()
         registry = Registry(package_name)
         self.registry = registry
     # FIXME: Investigate why we need the "autocommit=True" flag here.
     PyramidConfigurator.__init__(self,
                                  registry=registry, package=package,
                                  autocommit=autocommit, **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)
Пример #2
0
 def __init__(
     self,
     registry=None,
     package=None,
     settings=None,
     root_factory=None,
     security_policy=None,
     authentication_policy=None,
     authorization_policy=None,
     renderers=None,
     debug_logger=None,
     locale_negotiator=None,
     request_factory=None,
     response_factory=None,
     default_permission=None,
     session_factory=None,
     default_view_mapper=None,
     autocommit=False,
     exceptionresponse_view=default_exceptionresponse_view,
     route_prefix=None,
     introspection=True,
     root_package=None,
 ):
     if package is None:
         package = caller_package()
     if root_package is None:
         root_package = package
     name_resolver = DottedNameResolver(package)
     self.name_resolver = name_resolver
     self.package_name = name_resolver.get_package_name()
     self.package = name_resolver.get_package()
     self.root_package = root_package
     self.registry = registry
     self.autocommit = autocommit
     self.route_prefix = route_prefix
     self.introspection = introspection
     if registry is None:
         registry = Registry(self.package_name)
         self.registry = registry
         self.setup_registry(
             settings=settings,
             root_factory=root_factory,
             authentication_policy=authentication_policy,
             authorization_policy=authorization_policy,
             security_policy=security_policy,
             renderers=renderers,
             debug_logger=debug_logger,
             locale_negotiator=locale_negotiator,
             request_factory=request_factory,
             response_factory=response_factory,
             default_permission=default_permission,
             session_factory=session_factory,
             default_view_mapper=default_view_mapper,
             exceptionresponse_view=exceptionresponse_view,
         )
Пример #3
0
 def __init__(
     self,
     registry=None,
     package=None,
     settings=None,
     root_factory=None,
     authentication_policy=None,
     authorization_policy=None,
     renderers=None,
     debug_logger=None,
     locale_negotiator=None,
     request_factory=None,
     response_factory=None,
     default_permission=None,
     session_factory=None,
     default_view_mapper=None,
     autocommit=False,
     exceptionresponse_view=default_exceptionresponse_view,
     route_prefix=None,
     introspection=True,
     root_package=None,
 ):
     if package is None:
         package = caller_package()
     if root_package is None:
         root_package = package
     name_resolver = DottedNameResolver(package)
     self.name_resolver = name_resolver
     self.package_name = name_resolver.get_package_name()
     self.package = name_resolver.get_package()
     self.root_package = root_package
     self.registry = registry
     self.autocommit = autocommit
     self.route_prefix = route_prefix
     self.introspection = introspection
     if registry is None:
         registry = Registry(self.package_name)
         self.registry = registry
         self.setup_registry(
             settings=settings,
             root_factory=root_factory,
             authentication_policy=authentication_policy,
             authorization_policy=authorization_policy,
             renderers=renderers,
             debug_logger=debug_logger,
             locale_negotiator=locale_negotiator,
             request_factory=request_factory,
             response_factory=response_factory,
             default_permission=default_permission,
             session_factory=session_factory,
             default_view_mapper=default_view_mapper,
             exceptionresponse_view=exceptionresponse_view,
         )
Пример #4
0
 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)