Allow to use '*' and None as state in State object.

This commit is contained in:
Alex Root Junior 2018-06-28 19:24:25 +03:00
parent aa2468e19a
commit 4f0a3c607f

View file

@ -16,7 +16,11 @@ class State:
@property
def state(self):
if self._group_name is None and self._group:
if self._state is None:
return None
elif self._state == '*':
return self._state
elif self._group_name is None and self._group:
group = self._group.__full_group_name__
elif self._group_name:
group = self._group_name
@ -157,3 +161,7 @@ class StatesGroup(metaclass=MetaStatesGroup):
await state.set_state(last_step_name)
return last_step_name
default_state = State()
any_state = State(state='*')