Merge pull request #76 from sagittarian/state-change-hooks

Add hooks before and after a state change.
This commit is contained in:
Damien Elmes 2014-04-23 08:15:17 +09:00
commit 0233ecdb38

View file

@ -383,7 +383,9 @@ the manual for information on how to restore from an automatic backup."))
if cleanup: if cleanup:
cleanup(state) cleanup(state)
self.state = state self.state = state
runHook('beforeStateChange', state, oldState, *args)
getattr(self, "_"+state+"State")(oldState, *args) getattr(self, "_"+state+"State")(oldState, *args)
runHook('afterStateChange', state, oldState, *args)
def _deckBrowserState(self, oldState): def _deckBrowserState(self, oldState):
self.deckBrowser.show() self.deckBrowser.show()