Package pytilities :: Package event :: Module restricteddispatcher :: Class RestrictedDispatcher
[hide private]
[frames] | no frames]

Class RestrictedDispatcher

source code

object --+
         |
        RestrictedDispatcher


`Dispatcher` wrapper that filters the list of supported events.

Filter rules (in the specified order):

    - If it matches a disallow rule, it is not let through
    - If there are no allow rules, all the rest is let through
    - If there are allow rules, it must match an allow rule

Check `Dispatcher` for the documentation of the methods that are left
undocumented here.

Instance Methods [hide private]
 
__init__(self, dispatcher, allow=None, disallow=None)
Construct a restricted dispatcher.
source code
 
add_handler(self, event_name, handler, owner=None) source code
 
remove_handlers(self, event_name=None, owner=None) source code
 
remove_handler(self, event_name, handler, owner=None) source code
 
dispatch(self, event_name, *args, **keyword_args) source code
 
event(self, event_name, owner=None) source code
 
has_event(self, event_name) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  events

Inherited from object: __class__

Method Details [hide private]

__init__(self, dispatcher, allow=None, disallow=None)
(Constructor)

source code 

Construct a restricted dispatcher.

`disallow` takes precedence over `allow_events`.

Parameters:

    dispatcher :: Dispatcher
        the dispatcher to wrap around

    allow :: (string...):
        a list of events that are allowed. If `None`, all are allowed,
        unless they are in `disallow_events`

    disallow :: (string...)
        disallowed events

Overrides: object.__init__

Property Details [hide private]

events

Get Method:
unreachable.events(self)