Class reference

Reference for returned classes from some functions. These are not intended to be created by the user.

Watches

ItemNoUpdateWatch

class ItemNoUpdateWatch(name, secs)
EVENT

alias of ItemNoUpdateEvent

cancel()

Cancel the item watch

Return type:

None

listen_event(callback)

Listen to (only) the event that is emitted by this watcher

ItemNoChangeWatch

class ItemNoChangeWatch(name, secs)
EVENT

alias of ItemNoChangeEvent

cancel()

Cancel the item watch

Return type:

None

listen_event(callback)

Listen to (only) the event that is emitted by this watcher

InstantView

class InstantView(instant)
classmethod now()

Create a new instance with the current time

Return type:

InstantView

delta_now(now=None)

Return the delta between now and the instant. The delta will be positive, e.g. if the InstantView is from 5 seconds ago this will return a timedelta with 5 seconds.

Parameters:

now (InstantView | Instant | None) – optional instant to compare to instead of now, must be newer than the instant of the instant view

Return type:

TimeDelta

newer_than(obj=None, **kwargs)

Check if the instant is newer than the given value

older_than(obj=None, **kwargs)

Check if the instant is older than the given value

py_datetime()

Return the datetime of the instant

Return type:

datetime

py_timedelta(now=None)

Return the timedelta between the instant and now

Parameters:

now (InstantView | Instant | None) – optional instant to compare to

Return type:

timedelta