|
| def | __init__ (self, parent=None, items=None) |
| |
| def | create_break (self, *args, **kwargs) |
| |
| def | create_continue (self, *args, **kwargs) |
| |
| def | create_for (self, *args, **kwargs) |
| |
| def | create_if (self, *args, **kwargs) |
| |
| def | create_keyword (self, *args, **kwargs) |
| |
| def | create_message (self, *args, **kwargs) |
| |
| def | create_return (self, *args, **kwargs) |
| |
| def | create_try (self, *args, **kwargs) |
| |
| def | create_while (self, *args, **kwargs) |
| |
| def | filter (self, keywords=None, messages=None, predicate=None) |
| | Filter body items based on type and/or custom predicate. More...
|
| |
| def | flatten (self) |
| | Return steps so that IF and TRY structures are flattened. More...
|
| |
| def | register (cls, item_class) |
| |
| def | __add__ (self, other) |
| |
| def | __contains__ (self, item) |
| |
| def | __delitem__ (self, index) |
| |
| def | __eq__ (self, other) |
| |
| def | __getitem__ (self, index) |
| |
| def | __iadd__ (self, other) |
| |
| def | __imul__ (self, other) |
| |
| def | __init__ (self, item_class, common_attrs=None, items=None) |
| |
| def | __iter__ (self) |
| |
| def | __len__ (self) |
| |
| def | __lt__ (self, other) |
| |
| def | __mul__ (self, other) |
| |
| def | __repr__ (self) |
| |
| def | __reversed__ (self) |
| |
| def | __rmul__ (self, other) |
| |
| def | __setitem__ (self, index, item) |
| |
| def | __str__ (self) |
| |
| def | append (self, item) |
| |
| def | clear (self) |
| |
| def | count (self, item) |
| |
| def | create (self, *args, **kwargs) |
| |
| def | extend (self, items) |
| |
| def | index (self, item, *start_and_end) |
| |
| def | insert (self, index, item) |
| |
| def | reverse (self) |
| |
| def | sort (self) |
| |
| def | visit (self, visitor) |
| |
Base class for Body and Branches objects.
Definition at line 86 of file body.py.
| def robot.model.body.BaseBody.filter |
( |
|
self, |
|
|
|
keywords = None, |
|
|
|
messages = None, |
|
|
|
predicate = None |
|
) |
| |
Filter body items based on type and/or custom predicate.
To include or exclude items based on types, give matching arguments
``True`` or ``False`` values. For example, to include only keywords,
use ``body.filter(keywords=True)`` and to exclude messages use
``body.filter(messages=False)``. Including and excluding by types
at the same time is not supported and filtering my ``messages``
is supported only if the ``Body`` object actually supports messages.
Custom ``predicate`` is a callable getting each body item as an argument
that must return ``True/False`` depending on should the item be included
or not.
Selected items are returned as a list and the original body is not modified.
It was earlier possible to filter also based on FOR and IF types.
That support was removed in RF 5.0 because it was not considered useful
in general and because adding support for all new control structures
would have required extra work. To exclude all control structures, use
``body.filter(keywords=True, messages=True)`` and to only include them
use ``body.filter(keywords=False``, messages=False)``. For more detailed
filtering it is possible to use ``predicate``.
Definition at line 175 of file body.py.