glooey.helpers.HoldUpdatesMixin¶
- class glooey.helpers.HoldUpdatesMixin(num_holds=0)[source]¶
Bases:
object
Public Methods:
__init__
([num_holds])Private Methods:
Return all the updates that need to be applied, from a list of all the updates that were called while the hold was active.
- __dict__ = mappingproxy({'__module__': 'glooey.helpers', '__init__': <function HoldUpdatesMixin.__init__>, 'pause_updates': <function HoldUpdatesMixin.pause_updates>, 'resume_updates': <function HoldUpdatesMixin.resume_updates>, 'discard_updates': <function HoldUpdatesMixin.discard_updates>, 'hold_updates': <function HoldUpdatesMixin.hold_updates>, 'suppress_updates': <function HoldUpdatesMixin.suppress_updates>, '_filter_pending_updates': <function HoldUpdatesMixin._filter_pending_updates>, '__dict__': <attribute '__dict__' of 'HoldUpdatesMixin' objects>, '__weakref__': <attribute '__weakref__' of 'HoldUpdatesMixin' objects>, '__doc__': None, '__annotations__': {}})¶
- __module__ = 'glooey.helpers'¶
- __weakref__¶
list of weak references to the object (if defined)
- _filter_pending_updates()[source]¶
Return all the updates that need to be applied, from a list of all the updates that were called while the hold was active. This method is meant to be overridden by subclasses that want to customize how held updates are applied.
The
self._pending_updates
member variable is a list containing a (method, args, kwargs) tuple for each update that was called while updates were being held. This list is in the order that the updates were actually called, and any updates that were called more than once will appear in this list more than once.This method should yield or return a list of the tuples in the same format representing the updates that should be applied, in the order they should be applied. The default implementation filters out duplicate updates without changing their order. In cases where it matters, the last call to each update is used to determine the order.