summaryrefslogtreecommitdiff
path: root/repoze
AgeCommit message (Collapse)Author
2009-12-01We already had the values, no need to getattr them.Chris McDonough
2009-12-01Organize into public and private interfaces.Chris McDonough
2009-12-01Useless code.Chris McDonough
2009-11-30Get rid of misleading comment.Chris McDonough
2009-11-29(no commit message)Chris McDonough
2009-11-29- Trying to use an HTTP method name string such as ``GET`` as aChris McDonough
``request_type`` predicate caused a startup time failure when it was encountered in imperative configuration or in a decorator (symptom: ``Type Error: Required specification must be a specification``). This now works again, although ``request_method`` is a more modern predicate.
2009-11-28Get rid of these mentionings of zope.component for grep purposes.Chris McDonough
2009-11-28- Unit tests which use ``zope.testing.cleanup.cleanUp`` for theChris McDonough
purpose of isolating tests from one another may now begin to fail due to lack of isolation between tests. Here's why: In repoze.bfg 1.1 and prior, the registry returned by ``repoze.bfg.threadlocal.get_current_registry`` when no other registry had been pushed on to the threadlocal stack was the ``zope.component.globalregistry.base`` global registry (aka the result of ``zope.component.getGlobalSiteManager()``). In repoze.bfg 1.2+, however, the registry returned in this situation is the new module-scope ``repoze.bfg.registry.global_registry`` object. The ``zope.testing.cleanup.cleanUp`` function clears the ``zope.component.globalregistry.base`` global registry unconditionally. However, it does not know about the ``repoze.bfg.registry.global_registry`` object, so it does not clear it. If you use the ``zope.testing.cleanup.cleanUp`` function in the ``setUp`` of test cases in your unit test suite instead of using the (more correct as of 1.1) ``repoze.bfg.testing.setUp``, you will need to replace all calls to ``zope.testing.cleanup.cleanUp`` with a call to ``repoze.bfg.testing.setUp``. If replacing all calls to ``zope.testing.cleanup.cleanUp`` with a call to ``repoze.bfg.testing.setUp`` is infeasible, you can put this bit of code somewhere that is executed exactly **once** (*not* for each test in a test suite; in the `` __init__.py`` of your package would be a reasonable place):: import zope.testing.cleanup from repoze.bfg.testing import setUp zope.testing.cleanup.addCleanUp(setUp) - When there is no "current registry" in the ``repoze.bfg.threadlocal.manager`` threadlocal data structure (this is the case when there is no "current request" or we're not in the midst of a ``r.b.testing.setUp``-bounded unit test), the ``.get`` method of the manager returns a data structure containing a *global* registry. In previous releases, this function returned the global Zope "base" registry: the result of ``zope.component.getGlobalSiteManager``, which is an instance of the ``zope.component.registry.Component`` class. In this release, however, the global registry returns a globally importable instance of the ``repoze.bfg.registry.Registry`` class. This registry instance can always be imported as ``repoze.bfg.registry.global_registry``. Effectively, this means that when you call ``repoze.bfg.threadlocal.get_current_registry`` when no request or ``setUp`` bounded unit test is in effect, you will always get back the global registry that lives in ``repoze.bfg.registry.global_registry``. It also means that :mod:`repoze.bfg` APIs that *call* ``get_current_registry`` will use this registry. This change was made because :mod:`repoze.bfg` now expects the registry it uses to have a slightly different API than a bare instance of ``zope.component.registry.Components``.
2009-11-28(no commit message)Chris McDonough
2009-11-28Deal with registries we may not understand.Chris McDonough
2009-11-28Clarify.Chris McDonough
2009-11-28More windows friendliness.Chris McDonough
2009-11-28Deal with Windows.Chris McDonough
2009-11-28Allow initial registry setup to be called via a ``setup_registry`` method.Chris McDonough
Allow path specifications for renderers which are already resource specifications.
2009-11-28Bug found through interactive usage.Chris McDonough
2009-11-28Fix.Chris McDonough
2009-11-28Fix.Chris McDonough
2009-11-28General fixes.Chris McDonough
2009-11-28Fix up starter template generally.Chris McDonough
2009-11-28- Turn paths into resource specs in ZCML directives that useChris McDonough
context.path.
2009-11-27Terminology.Chris McDonough
2009-11-27Add threadlocal to API.Chris McDonough
2009-11-27Coverage.Chris McDonough
2009-11-27Coverage.Chris McDonough
Remove set_security_policies configurator API method.
2009-11-27renderer -> factory.Chris McDonough
2009-11-27configurator API docs.Chris McDonough
2009-11-27Cleanup.Chris McDonough
2009-11-27Move imports to module scope.Chris McDonough
2009-11-27ignore import error.Chris McDonough
2009-11-27Rendering.Chris McDonough
2009-11-27Rendering.Chris McDonough
2009-11-27- The ``repoze.bfg.testing.setUp`` function now accepts three extraChris McDonough
optional keyword arguments: ``registry``, ``request`` and ``hook_zca``. If the ``registry`` argument is not ``None``, the argument will be treated as the registry that is set as the "current registry" (it will be returned by ``repoze.bfg.threadlocal.get_current_registry``) for the duration of the test. If the ``registry`` argument is ``None`` (the default), a new registry is created and used for the duration of the test. The value of the ``request`` argument is used as the "current request" (it will be returned by ``repoze.bfg.threadlocal.get_current_request``) for the duration of the test; it defaults to ``None``. If ``hook_zca`` is ``True`` (the default), the ``zope.component.getSiteManager`` function will be hooked with a function that returns the value of ``registry`` (or the default-created registry if ``registry`` is ``None``) instead of the registry returned by ``zope.component.getGlobalSiteManager``, causing the Zope Component Architecture API (``getSiteManager``, ``getAdapter``, ``getUtility``, and so on) to use the registry we're using for testing instead of the global ZCA registry. - The ``repoze.bfg.testing.tearDown`` function now accepts an ``unhook_zca`` argument. If this argument is ``True`` (the default), ``zope.component.getSiteManager.reset()`` will be called, causing the "base" registry to once again start returnining the result of ``zope.component.getSiteManager``. - Remove hook_zca and unhook_zca methods from Configurator.
2009-11-27Less verbose.Chris McDonough
2009-11-27Get rid of ``zcml_file`` argument in configurator constructor in favor of ↵Chris McDonough
the load_zcml API. Get rid of hook_zca argument in configurator constructor in favor of a ``hook_zca`` method. Provide an ``unhook_zca`` method.
2009-11-26Add your bug here Malthe or Wiggy.Chris McDonough
2009-11-26Trying to determine what the real bug is.Chris McDonough
2009-11-26- When two views were registered with the same ``accept`` argument,Chris McDonough
but were otherwise registered with the same arguments, if a request entered the application which had an ``Accept`` header that accepted *either* of the media types defined by the set of views registered with predicates that otherwise matched, a more or less "random" one view would "win". Now, we try harder to use the view callable associated with the view configuration that has the most specific ``accept`` argument. Thanks to Alberto Valverde for an initial patch.
2009-11-25Import from the right place.Chris McDonough
2009-11-25We need to hook the zca before loading ZCML.Chris McDonough
2009-11-25Make sure the event implements.Chris McDonough
2009-11-25Import from the right package.Chris McDonough
2009-11-25This isn't really an object event in the sense that it is sent to an object ↵Chris McDonough
event listener.
2009-11-25Don't depend on adaptedBy.Chris McDonough
2009-11-25Don't hook getSiteManager during ZCML load (honor constructor argument only).Chris McDonough
2009-11-25- A dependency on the ``repoze.zcml`` package has been removed (itsChris McDonough
functionality is replaced internally).
2009-11-25- Replace martian with something simpler.Chris McDonough
2009-11-25Fixed issue where ``_query`` would be attempted URL encoded.Malthe Borch
2009-11-24Make hooking getSiteManager optional.Chris McDonough
2009-11-24Docs updates.Chris McDonough
2009-11-23Flesh out configuration chapter.Chris McDonough