@@ -140,6 +140,27 @@ async def page(self, client: Client, wanted_action: Callable, *args, **kwargs):
140140 solution_class = self .config .solution_class
141141 if not solution_class :
142142 raise TypeError ("no solution_class configured" )
143+
144+ action_result = await self .execute_action (client ,
145+ solution_class ,
146+ wanted_action ,
147+ * args ,
148+ ** kwargs )
149+ return action_result
150+
151+ async def execute_action (self , client : Client , solution_class , wanted_action : Callable , * args , ** kwargs ):
152+ """
153+ Execute the specified action on the solution instance.
154+
155+ Args:
156+ client (Client): The client making the request.
157+ solution_class: The solution class to create an instance for to execute the action on.
158+ wanted_action(Callable): The function to perform.
159+ args, *kwargs: Additional arguments to pass to the action.
160+
161+ Returns:
162+ The result of the action performed.
163+ """
143164 solution_instance = solution_class (self , client )
144165
145166 # Check if the solution_instance is an instance of solution_class or its subclass
@@ -164,7 +185,8 @@ async def page(self, client: Client, wanted_action: Callable, *args, **kwargs):
164185 # are done
165186 solution_instance .prepare_ui ()
166187
167- return await action (* args , ** kwargs )
188+ action_result = await action (* args , ** kwargs )
189+ return action_result
168190
169191 @classmethod
170192 def optionalDebug (self , args ):
0 commit comments