Package XPyLIB :: Module handler :: Class EventFilter
[hide private]
[frames] | no frames]

Class EventFilter

source code

object --+
         |
        EventFilter

Event filter for Handler.

Emulate event handler (with Handler). When has event and it buble from one object to another. If any object is return specified result (True for example) then bubling is stoped. Filter is filtered only "call" action. See EventFilter.__init__ and EventFilter.__call__.

Instance Methods [hide private]
 
__init__(self, StopIfTrue=True)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
bool
__call__(self, event, action, handler, *args, **kwds)
Callable function for handler filter.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, StopIfTrue=True)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Parameters:
  • StopIfTrue (bool = True) - Initialize stopIfTrue variable.
Overrides: object.__init__

__call__(self, event, action, handler, *args, **kwds)
(Call operator)

source code 

Callable function for handler filter.

See Handler.filter.
Parameters:
  • event (str) - Event type. May be "start", "pre", "post", "stop" events.
  • action (tuple) - Tuple of action - ("action", "name"). action may be "call", "get", "set". name - is a requested attribute name for "get" and "set" and None for "call".
  • handler (object) - Handler instance (not Handler class) for which called filter.
  • args - Additional arguments.
    • For "pre" + "call" - is function arguments.
    • For "pre" + "set" arg[0] - is value to setup.
    • For "post" arg[0] is result from handler.
  • kwds - Additional keywords. Applied only for "call" action.
Returns: bool
True for continue loop or False otherwise.