def __init__(self, entity_id, model, history_index=-1, connected=True):
"""Initialize a new entity
:param entity_id str: The unique id of the object in the model
:param model: The model instance in whose object tree this
entity resides
:history_index int: The index of this object's state in the model's
history deque for this entity
:connected bool: Flag indicating whether this object gets live updates
from the model.
"""
self.entity_id = entity_id
self.model = model
self._history_index = history_index
self.connected = connected
self.connection = model.connection()
评论列表
文章目录