buildgrid.server.operations.filtering package

Submodules

Module contents

class buildgrid.server.operations.filtering.OperationFilter(parameter, operator, value)

Bases: tuple

operator: Callable[[Any, Any], Any]

Alias for field number 1

parameter: str

Alias for field number 0

value: Any

Alias for field number 2

class buildgrid.server.operations.filtering.SortKey(name, descending)

Bases: tuple

descending: bool

Alias for field number 1

name: str

Alias for field number 0

class buildgrid.server.operations.filtering.FilterParser

Bases: object

Utility class primarily used to parse a filter string and return a list a OperationFilters.

lark_parser = Lark(open(PackageResource(pkg_name='buildgrid.server.operations.filtering', path='filter_grammar.lark')), parser='earley', lexer='dynamic', ...)
static parse_listoperations_filters(filter_string: str) list[buildgrid.server.operations.filtering.filter.OperationFilter]

Separate the lowercase filter string into individual components, and return a map containing the relevant filters to use.

Filter strings take the following form: key1=value1&key2=value2,value3&key3=value4 All spaces in the input are ignored.

Filter options are separated with ampersands (&). If a key is repeated, the combined set of values are treated as a logical conjunction (AND).