From 39480c04dedfcac3b0255f2030a3e58daae7dd0e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 13 Aug 2010 03:03:03 +0000 Subject: - The Configurator now accepts a dotted name *string* to a package as a ``package`` constructor argument. The ``package`` argument was previously required to be a package *object* (not a dotted name string). - The ``repoze.bfg.configuration.Configurator.with_package`` method was added. This method returns a new Configurator using the same application registry as the configurator object it is called upon. The new configurator is created afresh with its ``package`` constructor argument set to the value passed to ``with_package``. This feature will make it easier for future BFG versions to allow dotted names as arguments in places where currently only object references are allowed (the work to allow dotted names isntead of object references everywhere has not yet been done, however). - The ``repoze.bfg.configuration.Configurator.maybe_dotted`` method resolves a Python dotted name string supplied as its ``dotted`` argument to a global Python object. If the value cannot be resolved, a ``repoze.bfg.configuration.ConfigurationError`` is raised. If the value supplied as ``dotted`` is not a string, the value is returned unconditionally without any resolution attempted. --- docs/api/configuration.rst | 4 ++++ docs/whatsnew-1.3.rst | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'docs') diff --git a/docs/api/configuration.rst b/docs/api/configuration.rst index f555b18f0..ef0d7f631 100644 --- a/docs/api/configuration.rst +++ b/docs/api/configuration.rst @@ -22,6 +22,10 @@ .. automethod:: get_settings + .. automethod:: with_package + + .. automethod:: maybe_dotted + .. automethod:: setup_registry(settings=None, root_factory=None, authentication_policy=None, renderers=DEFAULT_RENDERERS, debug_logger=None, locale_negotiator=None, request_factory=None, renderer_globals_factory=None) .. automethod:: add_renderer(name, factory) diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 07f63b9d6..f72a76e19 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -271,6 +271,24 @@ Minor Feature Additions callable calling convention of ``(context, request)`` (``context`` will be the exception object). +- The :class:`repoze.bfg.configuration.Configurator` constructor now + accepts a dotted name *string* to a package as a ``package`` + argument. The ``package`` argument was previously required to be a + package *object* (not a dotted name string). + +- The :meth:`repoze.bfg.configuration.Configurator.with_package` + method was added. This method returns a new Configurator using the + same application registry as the configurator object it is called + upon. The new configurator is created afresh with its ``package`` + constructor argument set to the value passed to ``with_package``. + +- The :meth:`repoze.bfg.configuration.Configurator.maybe_dotted` + method resolves a Python dotted name string supplied as its + ``dotted`` argument to a global Python object. If the value cannot + be resolved, a :exc:`repoze.bfg.configuration.ConfigurationError` is + raised. If the value supplied as ``dotted`` is not a string, the + value is returned unconditionally without any resolution attempted. + Backwards Incompatibilities --------------------------- -- cgit v1.2.3