summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-11-04Tweak.Chris McDonough
2009-11-04(no commit message)Chris McDonough
2009-11-04Gah.Chris McDonough
2009-11-04Note bw incompat.Chris McDonough
2009-11-04- The ``bfgshell`` command did not function properly; it was stillChris McDonough
expecting to be able to call the root factory with a bare ``environ`` rather than a request object. - The ``repoze.bfg.scripting.get_app`` function now expects a ``request`` object as its second argument rather than an ``environ``.
2009-11-02Typos.Chris McDonough
2009-11-02- Compound statements that used an assignment entered into in anChris McDonough
interactive IPython session invoked via ``paster bfgshell`` no longer fail to mutate the shell namespace correctly. For example, this set of statements used to fail:: In [2]: def bar(x): return x ...: In [3]: list(bar(x) for x in 'abc') Out[3]: NameError: 'bar' In this release, the ``bar`` function is found and the correct output is now sent to the console. Thanks to Daniel Holth for the patch.
2009-11-02- Prevent PyPI installation failure due to ``easy_install`` trying wayChris McDonough
too hard to guess the best version of Paste. When ``easy_install`` pulls from PyPI it reads links off various pages to determine "more up to date" versions. It incorrectly picks up a link for an ancient version of a package named "Paste-Deploy-0.1" (note the dash) when trying to find the "Paste" distribution and somehow believes it's the latest version of "Paste". It also somehow "helpfully" decides to check out a version of this package from SVN. We pin the Paste dependency version to a version greater than 1.7 to work around this ``easy_install`` bug. - Prep for 1.1b2.
2009-11-02- Add a new event type: ``repoze.bfg.events.AfterTraversal``. EventsChris McDonough
of this type will be sent after traversal is completed, but before any view code is invoked. Like ``repoze.bfg.events.NewRequest``, This event will have a single attribute: ``request`` representing the current request. Unlike the request attribute of ``repoze.bfg.events.NewRequest`` however, during an AfterTraversal event, the request object will possess attributes set by the traverser, most notably ``context``, which will be the context used when a view is found and invoked. The interface ``repoze.bfg.events.IAfterTraversal`` can be used to subscribe to the event. For example:: <subscriber for="repoze.bfg.interfaces.IAfterTraversal" handler="my.app.handle_after_traverse"/> Like any framework event, a subscriber function should expect one parameter: ``event``.
2009-11-02New nosetests output status.Chris McDonough
2009-11-02(no commit message)Chris McDonough
2009-11-02Depend on new "Chameleon" package (rather than individual chameleon.zpt and ↵Chris McDonough
chameleon.core packages). Somehow we also need to depend on sourcecodegen or the tests fail (even though Chameleon depends on them too). Don't run coverage tests by default when running nosetests (pass --with-coverage to "setup.py nosetests" to obtain the older behavior). Ignore .coverage in trunk/repoze/bfg Pass where=repoze/bfg to avoid running other repoze tests, for whatever reason.
2009-11-02(no commit message)Chris McDonough
2009-11-02(no commit message)Chris McDonough
2009-11-02- "What's New in ``repoze.bfg`` 1.1" document added to narrativeChris McDonough
documentation. - Minor typo fixes.
2009-11-01Fix ZCML definition.Chris McDonough
2009-11-01Add route predicate and route configuration glossary entries.Chris McDonough
2009-11-01View callable definition.Chris McDonough
2009-11-01Remove incorrect docs from hybrid chapter.Chris McDonough
Organize changelog of 1.1a1 into categories.
2009-11-01Prep for 1.1b1.Chris McDonough
2009-11-01- Fix various tutorials broken by 1.1a9 ``<route>`` directive changes.Chris McDonough
2009-11-01Leave some confusing and near-useless params undocumented.Chris McDonough
2009-11-01(no commit message)Chris McDonough
2009-11-01(no commit message)Chris McDonough
2009-11-01- Header values returned by the ``authtktauthenticationpolicy``Chris McDonough
``remember`` and ``forget`` methods would be of type ``unicode`` if the ``cookie_name`` attribute was used in the ZCML declaration. This violated the WSGI spec, causing a ``TypeError`` to be raised when these headers were used under ``mod_wsgi``. - If a routes-only BFG app was mounted under a path in modwsgi, ala ``WSGIScriptAlias /myapp /Users/chrism/projects/modwsgi/env/bfg.wsgi``, the home route (a route with the path of ``'/'`` or ``''``) would not match when the path ``/myapp`` was visited (only when the path ``/myapp/`` was visited). This is now fixed: if the urldispatch root factory notes that the PATH_INFO is empty, it converts it to a single slash before trying to do matching.
2009-11-01- Reinstate ``renderer`` alias for ``view_renderer`` in theChris McDonough
``<route>`` ZCML directive (in-the-wild 1.1a bw compat). - ``bfg_routesalchemy`` paster template: change ``<route>`` declarations: rename ``renderer`` attribute to ``view_renderer``. - In ``<route>`` declarations in tutorial ZCML, rename ``renderer`` attribute to ``view_renderer`` (fwd compat).
2009-11-01- The routes root factory called route factories and the default routeChris McDonough
factory with an environ rather than a request. One of the symptoms of this bug: applications generated using the ``bfg_zodb`` paster template in 1.1a9 did not work properly.
2009-11-01- Deal with a potential circref in the traversal module.Chris McDonough
2009-11-01Get the date right.Chris McDonough
2009-11-01Prep for 1.1a9.Chris McDonough
2009-11-01(no commit message)Chris McDonough
2009-11-01- The ZCML ``route`` directive's attributes ``xhr``,Chris McDonough
``request_method``, ``path_info``, ``request_param``, ``header`` and ``accept`` are now *route* predicates rather than *view* predicates. If one or more of these predicates is specified in the route configuration, all of the predicates must return true for the route to match a request. If one or more of the route predicates associated with a route returns ``False`` when checked during a request, the route match fails, and the next match in the routelist is tried. This differs from the previous behavior, where no route predicates existed and all predicates were considered view predicates, because in that scenario, the next route was not tried.
2009-11-01- The ``repoze.bfg.functional`` module was renamed toChris McDonough
``repoze.bfg.compat``.
2009-11-01Unused import.Chris McDonough
2009-10-31Fix default root factory in the face of changes to root factory construction ↵Chris McDonough
arg.
2009-10-31Comment logical parts of Router.__call__Chris McDonough
2009-10-31- Explicitly revert the feature introduced in 1.1a8: where the nameChris McDonough
``root`` is available as an attribute of the request before a NewRequest event is emitted. This makes some potential future features impossible, or at least awkward (such as grouping traversal and view lookup into a single adapter lookup).
2009-10-30Update documentation after root factory changes.Chris McDonough
2009-10-30(no commit message)Chris McDonough
2009-10-30- The ``__call__`` of a plugin "traverser" implementation (registeredChris McDonough
as an adapter for ``ITraverser`` or ``ITraverserFactory``) will now receive a *request* as the single argument to its ``__call__`` method. In previous versions it was passed a WSGI ``environ`` object. The request object passed to the factory implements dictionary-like methods in such a way that existing traverser code which expects to be passed an environ will continue to work. - Fix docs.
2009-10-30FeaturesChris McDonough
-------- - In previous versions of BFG, the "root factory" (the ``get_root`` callable passed to ``make_app`` or a function pointed to by the ``factory`` attribute of a route) was called with a "bare" WSGI environment. In this version, and going forward, it will be called with a ``request`` object. The request object passed to the factory implements dictionary-like methods in such a way that existing root factory code which expects to be passed an environ will continue to work. Internal -------- - The request implements dictionary-like methods that mutate and query the WSGI environ. This is only for the purpose of backwards compatibility with root factories which expect an ``environ`` rather than a request. - The ``repoze.bfg.request.create_route_request_factory`` function, which returned a request factory was removed in favor of a ``repoze.bfg.request.route_request_interface`` function, which returns an interface. - The ``repoze.bfg.request.Request`` class, which is a subclass of ``webob.Request`` now defines its own ``__setattr__``, ``__getattr__`` and ``__delattr__`` methods, which override the default WebOb behavior. The default WebOb behavior stores attributes of the request in ``self.environ['webob.adhoc_attrs']``, and retrieves them from that dictionary during a ``__getattr__``. This behavior was undesirable for speed and "expectation" reasons. Now attributes of the ``request`` are stored in ``request.__dict__`` (as you otherwise might expect from an object that did not override these methods). - Reverse the order in which the router calls the request factory and the root factory. The request factory is now called first; the resulting request is passed to the root factory. - The ``repoze.bfg.request.request_factory`` function has been removed. Its functionality is no longer required. - The "routes root factory" that wraps the default root factory when there are routes mentioned in the configuration now attaches an interface to the request via ``zope.interface.directlyProvides``. This replaces logic in the (now-gone) ``repoze.bfg.request.request_factory`` function. - The ``route`` and ``view`` ZCML directives now register an interface as a named utility (retrieved from ``repoze.bfg.request.route_request_interface``) rather than a request factory (the previous return value of the now-missing ``repoze.bfg.request.create_route_request_factory``.
2009-10-30Normalize level param.Chris McDonough
2009-10-29- The ``repoze.bfg.request.Request`` class, which is a subclass ofChris McDonough
``webob.Request`` now defines its own ``__setattr__``, ``__getattr__`` and ``__delattr__`` methods, which override the default WebOb behavior. The default WebOb behavior stores attributes of the request in ``self.environ['webob.adhoc_attrs']``, and retrieves them from that dictionary during a ``__getattr__``. This behavior was undesirable for speed and "expectation" reasons. Now attributes of the ``request`` are stored in ``request.__dict__`` (as you otherwise might expect from an object that did not override these methods). - The router no longer calls ``repoze.bfg.traversal._traverse`` and does its work "inline" (speed).
2009-10-29- An incorrect ZCML conflict would be encountered when theChris McDonough
``request_param`` predicate attribute was used on the ZCML ``view`` directive if any two otherwise same-predicated views had the combination of a predicate value with an ``=`` sign and one without (e.g. ``a`` vs. ``a=123``).
2009-10-28Prep for 1.1a8.Chris McDonough
2009-10-26Readd backward compat for ITraverserFactory -> ITraverser change.Chris McDonough
2009-10-26Revert 6873, as it introduces an unnecessary providedBy for each request in ↵Chris McDonough
the 99% case, and its behavior can be emulated by returning a root object that implements some interface and registering a traverser for that interface.
2009-10-26The root factory may now return an object which implements ``ITraverser`` ↵Malthe Borch
directly. In this case, no adaptation is done before traversal. This feature is added such that a routes factory can implement its own traversal logic without establishing an artificial context only to get a hook into the traversal machinery.
2009-10-26Adapt to ``ITraverser`` instead of ``ITraverserFactory``. While this change ↵Malthe Borch
breaks backwards compatibility, migration is trivial.
2009-10-26Dead code.Chris McDonough