Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Mar 19, 2013
  1. @mmerickel

    update CHANGES.txt

    mmerickel authored
  2. @mmerickel
  3. @wosc

    Fixes #798: Allow a protocol-relative URL to be passed to add_static_…

    wosc authored
    …view, generate URLs using the current protocol.
  4. @mmerickel
  5. @mmerickel

    support acl as a callable

    mmerickel authored
Commits on Mar 12, 2013
  1. @mmerickel

    Merge pull request #896 from tshepang/consistency

    mmerickel authored
    consistency fixes
Commits on Mar 9, 2013
  1. @tshepang

    consistency

    tshepang authored
Commits on Mar 4, 2013
  1. @tshepang
Commits on Jan 10, 2013
  1. @latteier

    Change log note.

    latteier authored
Commits on Jan 2, 2013
  1. @tshepang
Commits on Jan 1, 2013
  1. @tshepang
Commits on Dec 18, 2012
  1. @mcdonc

    prep for 1.4

    mcdonc authored
  2. @mcdonc

    garden

    mcdonc authored
Commits on Dec 11, 2012
  1. @mcdonc

    prep for 1.4b3

    mcdonc authored
Commits on Dec 10, 2012
  1. @mcdonc

    prep for 1.4b2

    mcdonc authored
Commits on Dec 7, 2012
  1. @mcdonc

    add changenote

    mcdonc authored
Commits on Dec 6, 2012
  1. @mmerickel

    _depth argument to view_config is now relative to view_config

    mmerickel authored
    This hides an implementation detail that view_config is at least 1 level away
    from user code.
Commits on Nov 22, 2012
  1. @mcdonc

    prep for 1.4b1

    mcdonc authored
Commits on Nov 21, 2012
  1. @mcdonc

    garden

    mcdonc authored
  2. @mcdonc

    garden

    mcdonc authored
  3. @mcdonc

    - In order to normalize the relationship between event subscribers and

    mcdonc authored
      subscriber predicates, we now allow both subscribers and subscriber
      predicates to accept only a single ``event`` argument even if they've been
      subscribed for notifications that involve multiple interfaces.  Subscribers
      and subscriber predicates that accept only one argument will receive the
      first object passed to ``notify``; this is typically (but not always) the
      event object.  The other objects involved in the subscription lookup will be
      discarded.
    
      For instance, if an event is sent by code like this::
    
         registry.notify(event, context)
    
      In the past, in order to catch such an event, you were obligated to write and
      register an event subscriber that mentioned both the event and the context in
      its argument list::
    
         @subscriber([SomeEvent, SomeContextType])
         def subscriber(event, context):
             pass
    
      With the event-only feature you can now write an event subscriber that
      accepts only ``event`` even if it subscribes to multiple interfaces::
    
         @subscriber([SomeEvent, SomeContextType])
         def subscriber(event):
             # this will work!
    
      Note, however, that if the event object is not the first object in the call
      to ``notify``, you'll run into trouble.  For example, if notify is called
      with the context argument first::
    
         registry.notify(context, event)
    
      You won't be able to take advantage of the feature.  It will "work", but the
      object received by your event handler won't be the event object, it will be
      the context object, which won't be very useful::
    
         @subscriber([SomeContextType, SomeEvent])
         def subscriber(event):
             # bzzt! you'll be getting the context here as ``event``, and it'll
             # be useless
    
      Existing multiple-argument subscribers continue to work without issue, so you
      should continue use those if your system notifies using multiple interfaces
      and the first interface is not the event interface.  For example::
    
         @subscriber([SomeContextType, SomeEvent])
         def subscriber(context, event):
             # this will still work!
    
      The event-only feature makes it possible to use a subscriber predicate that
      accepts only a request argument within both multiple-interface subscriber
      registrations and single-interface subscriber registrations.  In the past, if
      you had a subscriber predicate like this::
    
        class RequestPathStartsWith(object):
            def __init__(self, val, config):
                self.val = val
    
            def text(self):
                return 'path_startswith = %s' % (self.val,)
    
            phash = text
    
            def __call__(self, event):
                return event.request.path.startswith(self.val)
    
      If you attempted to use the above predicate to condition a subscription that
      involved multiple interfaces, it would not work.  You had to change it to
      accept the same arguments as the subscription itself.  For example, you might
      have had to change its ``__call__`` method like so, adding a ``context``
      argument::
    
            def __call__(self, event, context):
                return event.request.path.startswith(self.val)
    
      With the event-only feature, you needn't make the change.  Instead, you can
      write all predicates so they only accept ``event`` in their ``__call__`` and
      they'll be useful across all registrations for subscriptions that use an
      event as their first argument, even ones which accept more than just
      ``event``.  However, the same caveat applies to predicates as to
      subscriptions: if you're subscribing to a multi-interface event, and the
      first interface is not the event interface, the predicate won't work
      properly.  In such a case, you'll need to match the predicate ``__call__``
      argument ordering and composition to the ordering of the interfaces.  For
      example::
    
            def __call__(self, context, event):
                return event.request.path.startswith(self.val)
    
      tl;dr: 1) Always use the event as the first argument to a multi-interface
      subscription and 2) Use only ``event`` in your subscriber and subscriber
      predicate parameter lists, no matter how many interfaces the subscriber is
      notified with, as long as the event object is the first argument passed to
      ``registry.notify``.  This will result in the maximum amount of reusability
      of subscriber predicates.
  4. @mcdonc

    garden

    mcdonc authored
  5. @mcdonc

    garden

    mcdonc authored
  6. @mcdonc

    garden

    mcdonc authored
Commits on Nov 20, 2012
  1. @mcdonc

    - Small microspeed enhancement which anticipates that a

    mcdonc authored
      ``pyramid.response.Response`` object is likely to be returned from a view.
      Some code is shortcut if the class of the object returned by a view is this
      class.  A similar microoptimization was done to
      ``pyramid.request.Request.is_response``.
Commits on Nov 19, 2012
  1. @mcdonc

    - A failure when trying to locate the attribute ``__text__`` on route…

    mcdonc authored
    … and view
    
      predicates existed when the ``debug_routematch`` setting was true or when the
      ``pviews`` command was used. See #727
    
    Closes #727.
Commits on Nov 14, 2012
  1. @mcdonc

    prep for release

    mcdonc authored
  2. @mcdonc

    rearrange deck chairs

    mcdonc authored
  3. @mmerickel

    updated changelog

    mmerickel authored
Commits on Nov 12, 2012
  1. @mmerickel
  2. @rob0t7
Commits on Nov 11, 2012
  1. @mcdonc
  2. @mcdonc

    - Be more tolerant of potential error conditions in ``match_param`` and

    mcdonc authored
      ``physical_path`` predicate implementations; instead of raising an exception,
      return False.
Commits on Nov 5, 2012
  1. @mmerickel

    update changelog, close #627

    mmerickel authored
Commits on Nov 4, 2012
  1. @mcdonc

    - Allow a ``_depth`` argument to ``pyramid.view.view_config``, which …

    mcdonc authored
    …will
    
      permit limited compisition reuse of the decorator by other software that
      wants to provide custom decorators that are much like view_config.
    
    Closes #637.
Something went wrong with that request. Please try again.