File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -74,12 +74,18 @@ class MyStates(StatesGroup):
7474 my_state = State() # returns my_state:State string.
7575 """
7676 def __init_subclass__ (cls ) -> None :
77-
77+ state_list = []
7878 for name , value in cls .__dict__ .items ():
7979 if not name .startswith ('__' ) and not callable (value ) and isinstance (value , State ):
8080 # change value of that variable
8181 value .name = ':' .join ((cls .__name__ , name ))
8282 value .group = cls
83+ state_list .append (value )
84+ cls ._state_list = state_list
85+
86+ @property
87+ def state_list (self ):
88+ return self ._state_list
8389
8490
8591class SkipHandler :
Original file line number Diff line number Diff line change @@ -185,13 +185,20 @@ class MyStates(StatesGroup):
185185 my_state = State() # returns my_state:State string.
186186 """
187187 def __init_subclass__ (cls ) -> None :
188+ state_list = []
188189 for name , value in cls .__dict__ .items ():
189190 if not name .startswith ('__' ) and not callable (value ) and isinstance (value , State ):
190191 # change value of that variable
191192 value .name = ':' .join ((cls .__name__ , name ))
192193 value .group = cls
194+ state_list .append (value )
195+ cls ._state_list = state_list
196+
197+ @property
198+ def state_list (self ):
199+ return self ._state_list
200+
193201
194-
195202class BaseMiddleware :
196203 """
197204 Base class for middleware.
You can’t perform that action at this time.
0 commit comments