selinon.builtin_predicate module¶
Built-in predicates used as core building blocks to build predicates.
-
class
selinon.builtin_predicate.
AlwaysTruePredicate
(flow)[source]¶ Bases:
selinon.builtin_predicate.BuiltinPredicate
Predicate used if condition in config file is omitted.
-
ast
()[source]¶ Python AST of this predicate (construct transitively for all indirect children as well).
Returns: AST of describing all children predicates
-
static
create
(tree, nodes_from, flow, can_inspect_results)[source]¶ Create the predicate.
Parameters: Returns: Predicate instance
-
nodes_used
()[source]¶ Compute all nodes that are used (transitively) by child/children.
Returns: list of nodes that are used Return type: List[Node]
-
-
class
selinon.builtin_predicate.
AndPredicate
(children)[source]¶ Bases:
selinon.builtin_predicate.NaryPredicate
And predicate representation.
-
ast
()[source]¶ Python AST of this predicate (construct transitively for all indirect children as well).
Returns: AST of describing all children predicates
-
-
class
selinon.builtin_predicate.
BuiltinPredicate
[source]¶ Bases:
selinon.predicate.Predicate
Build in predicate abstract class.
-
class
selinon.builtin_predicate.
NaryPredicate
(children)[source]¶ Bases:
selinon.builtin_predicate.BuiltinPredicate
N-ary predicate abstract class.
-
nodes_used
()[source]¶ Compute nodes that are used (transitively).
Returns: list of nodes that are used Return type: List[Node]
-
-
class
selinon.builtin_predicate.
NotPredicate
(child)[source]¶ Bases:
selinon.builtin_predicate.UnaryPredicate
Unary or predicate representation.
-
ast
()[source]¶ Python AST of this predicate (construct transitively for all indirect children as well).
Returns: AST of describing all children predicates
-
-
class
selinon.builtin_predicate.
OrPredicate
(children)[source]¶ Bases:
selinon.builtin_predicate.NaryPredicate
And predicate representation.
-
ast
()[source]¶ Python AST of this predicate (construct transitively for all indirect children as well).
Returns: AST of describing all children predicates
-
-
class
selinon.builtin_predicate.
UnaryPredicate
(child)[source]¶ Bases:
selinon.builtin_predicate.BuiltinPredicate
Unary predicate abstract class.
-
nodes_used
()[source]¶ Compute all nodes that are used (transitively) by child/children.
Returns: list of nodes that are used Return type: List[Node]
-