# HG changeset patch # User Thinker K.F. Li # Date 1294737896 -28800 # Node ID 2609b219703d5d8563c1e42663d1b916cdf6afe1 # Parent 027cd060d9ba0288d0c21ca973010a58fcbb986e Move initialize of consistency_checker to domview_ui_with_workers diff -r 027cd060d9ba -r 2609b219703d pyink/MBScene.py --- a/pyink/MBScene.py Tue Jan 11 15:03:01 2011 +0800 +++ b/pyink/MBScene.py Tue Jan 11 17:24:56 2011 +0800 @@ -7,7 +7,7 @@ import traceback import pybInkscape from tween import scenes_director -from domview_ui import domview_ui +from domview_ui import create_domview_ui from data_monitor import data_monitor # Please refer to @@ -69,7 +69,7 @@ self._disable_tween_type_selector = False self.current = 0 - self._domview = domview_ui() + self._domview = create_domview_ui() pass def change_active_frame(self, node): diff -r 027cd060d9ba -r 2609b219703d pyink/domview_ui.py --- a/pyink/domview_ui.py Tue Jan 11 15:03:01 2011 +0800 +++ b/pyink/domview_ui.py Tue Jan 11 17:24:56 2011 +0800 @@ -361,7 +361,6 @@ self._dom = domview() self._doc = None self._root = None - self._consistency_checker = consistency.consistency_checker(self) self._lock = False pass @@ -410,7 +409,6 @@ self._doc = doc self._root = root - self._consistency_checker.handle_doc_root(doc, root) pass ## \brief Mark given frame as a key frame. @@ -654,3 +652,27 @@ return True pass + +## \brief A mix-in to enable workers for a domview_ui. +# +class domview_ui_with_workers(domview_ui): + def __init__(self): + super(domview_ui_with_workers, self).__init__() + + self._consistency_checker = consistency.consistency_checker(self) + pass + + def handle_doc_root(self, doc, root): + super(domview_ui_with_workers, self).handle_doc_root(doc, root) + + self._consistency_checker.handle_doc_root(doc, root) + pass + pass + + +## \brief Factory function of domview_ui. +# +def create_domview_ui(): + domview = domview_ui_with_workers() + return domview +