requires_state
#
- biotite.application.requires_state(app_state)[source]#
A decorator for methods of
Application
subclasses that raises anAppStateError
in case the method is called, when theApplication
is not in the specifiedAppState
app_state.- Parameters:
- app_stateAppState
The required app state.
Examples
Raises
AppStateError
when function is called, ifApplication
is not in one of the specified states:>>> @requires_state(AppState.RUNNING | AppState.FINISHED) ... def function(self): ... pass