tiled.queries.KeyLike#
- class tiled.queries.KeyLike(key: str, before: bool = True, after: bool = True)[source]#
Match entries whose key contains, starts with, or ends with some text.
The match is case-sensitive. The text is matched literally: characters such as
%,_, and*have no special meaning.At least one of
beforeoraftermust be True. For an exact match, use an exact-key query (KeyLookuporKeysFilter).- Parameters:
- keystr
Text to look for in the entries’ keys. Must not be empty.
- beforebool, optional
Allow other characters before the text. Default True.
- afterbool, optional
Allow other characters after the text. Default True.
Examples
Search for keys that contain “scan”
>>> c.search(KeyLike("scan"))
Search for keys that start with “scan”
>>> c.search(KeyLike("scan", before=False))
Search for keys that end with “scan”
>>> c.search(KeyLike("scan", after=False))
Methods
__bool__()__delattr__(name, /)Implement delattr(self, name).
__dir__(/)Default dir() implementation.
__eq__(other)Return self==value.
__format__(format_spec, /)Default object formatter.
__ge__(value, /)Return self>=value.
__getattribute__(name, /)Return getattr(self, name).
__getstate__(/)Helper for pickle.
__gt__(value, /)Return self>value.
__init__(key[, before, after])__init_subclass__This method is called when a class is subclassed.
__le__(value, /)Return self<=value.
__lt__(value, /)Return self<value.
__ne__(value, /)Return self!=value.
__new__(*args, **kwargs)__post_init__()__reduce__(/)Helper for pickle.
__reduce_ex__(protocol, /)Helper for pickle.
__repr__()Return repr(self).
__setattr__(name, value, /)Implement setattr(self, name, value).
__sizeof__(/)Size of object in memory, in bytes.
__str__(/)Return str(self).
__subclasshook__Abstract classes can override this to customize issubclass().
decode(*, key[, before, after])encode()Attributes
__annotations____dataclass_fields____dataclass_params____dict____doc____hash____match_args____module____weakref__list of weak references to the object
afterbeforekey