def __init__(self): self._cells = {} for name in [n for n in dir(self) if n.startswith('_get_')]: getf = getattr(self, name) cell_name = name[5:] cell = ComputedCell(getf) self._cells[cell_name] = cell
def unregister_dependant(self, dependant): ComputedCell.unregister_dependant(self, dependant) if not self.dependants: self.empty_callback()
def __init__(self, function, empty_callback=lambda:None): ComputedCell.__init__(self, function) # Called when there are no more dependants: self.empty_callback = empty_callback
def __init__(self, function, empty_callback=lambda: None): ComputedCell.__init__(self, function) # Called when there are no more dependants: self.empty_callback = empty_callback