FilterList#

class FilterList#

Bases: object

Container for filters.

Has minimal interface: __getitem__, __len__, __iter__, __contains__

add(func, **kwargs)#

Add a basic filter.

Parameters:

func (Callable[[Finder, str, Matches], bool])

Return type:

Filter

add_by_date(func, default_date=None, **kwargs)#

Add a date filter.

Parameters:
Return type:

FilterByDate

add_by_group(func, indices, pass_unparsed=False, **kwargs)#

Add a group filter.

Parameters:
Return type:

FilterByGroup

clear()#

Remove all filters.

is_valid(finder, filename, matches)#

Return if the filename is valid.

All filters are executed unless one rejects the filename.

Parameters:
Return type:

bool

remove_by_date()#

Remove all date filters.

remove_by_group(indices)#

Remove groups from all filters.

Every group filter indices has every index in the argument removed. Its match won’t be sent to the filter anymore. If there is no index left, the filter is completely removed.

Parameters:

indices (Sequence[int])

filters: list[Filter]#

List of filters.