5.2.3. vlcp.event.event

Note

This document is generated from the source file.

View Source on GitHub

Created on 2015/06/01

author:hubo
class vlcp.event.event.DiffRef_(origin, add)

Append some matchers to a diff without breaking the difference structure

__init__(origin, add)

Initialize self. See help(type(self)) for accurate signature.

two_way_difference(b)

Return (self - b, b - self)

class vlcp.event.event.Diff_(base=(), add=(), remove=())

Special “differenced” set. Items in ‘base’, ‘add’, ‘remove’ must not be same

Used by wait_for_all

__init__(base=(), add=(), remove=())

Initialize self. See help(type(self)) for accurate signature.

two_way_difference(b, extra_add=(), extra_remove=())

Return (self - b, b - self)

class vlcp.event.event.Event(*args, **kwargs)

A generated event with indices

__init__(*args, **kwargs)
Parameters:
  • args – index values like 12,”read”,… content are type-depended.
  • kwargs
    indices
    input indices by name
    canignore
    if the event is not processed, whether it is safe to ignore the event.

    If it is not, the processing queue might be blocked to wait for a proper event processor. Default to True.

    others
    the properties will be set on the created event
__repr__()

Return repr(self).

canignorenow()

Extra criteria for an event with canignore = False. When this event returns True, the event is safely ignored.

classmethod createMatcher(*args, **kwargs)
Parameters:
  • _ismatch – user-defined function ismatch(event) for matching test
  • *args – indices
  • **kwargs – index_name=index_value for matching criteria
classmethod getTypename()
Returns:return the proper name to match
classmethod indicesNames()
Returns:names of indices
class vlcp.event.event.EventMatcher(indices, judgeFunc=None)

A matcher to match an event

__await__()

event = yield from matcher

or

event = await matcher

__init__(indices, judgeFunc=None)

Initialize self. See help(type(self)) for accurate signature.

__repr__()

Return repr(self).

exception vlcp.event.event.IsMatchExceptionWarning
class vlcp.event.event.M_(*matchers)

Awaitable object for multiple matchers

` event, matcher = await M_(matcher1, matcher2) `

__await__()

` event, matcher = yield from M_(matcher1, matcher2) `

equivalent to

` event, matcher = yield (matcher1, matcher2) `

__init__(*matchers)

Initialize self. See help(type(self)) for accurate signature.

vlcp.event.event.withIndices(*args)

Create indices for an event class. Every event class must be decorated with this decorator.

vlcp.event.event.with_indices(*args)

Create indices for an event class. Every event class must be decorated with this decorator.