pyface.viewer.viewer_filter module

Abstract base class for all viewer filters.

class pyface.viewer.viewer_filter.ViewerFilter[source]

Bases: HasTraits

Abstract base class for all viewer filters.

filter(viewer, parent, elements)[source]

Filters a list of elements.

‘viewer’ is the viewer that we are filtering elements for. ‘parent’ is the parent element. ‘elements’ is the list of elements to filter.

Returns a list containing only those elements for which ‘select’ returns True.

select(viewer, parent, element)[source]

Returns True if the element is ‘allowed’ (ie. NOT filtered).

‘viewer’ is the viewer that we are filtering elements for. ‘parent’ is the parent element. ‘element’ is the element to select.

By default we return True.

is_filter_trait(element, trait_name)[source]

Is the filter affected by changes to an element’s trait?

‘element’ is the element. ‘trait_name’ is the name of the trait.

Returns True if the filter would be affected by changes to the trait named ‘trait_name’ on the specified element.

By default we return False.