View Single Post
Posts: 356 | Thanked: 123 times | Joined on Dec 2008
#806
Can you give me any hints on how to call a function in state_machine.py from an external python script? I added the following two functions to state_machine.py:

Code:
        def update_now(self):
                self._update_now()

        def _update_now(self):
                self._onTimeout.cancel()
                self._strategy.reinitialize_state()
                self._strategy.increment_state()
                self._onTimeout.start(seconds=1)
I can call update_now from within debug_prompt.py (I added the following command that runs when "reset_state_machine textsnow" is run from the debug prompt) (see line ~80):

Code:
self._conn.session.textsStateMachine.update_now()