@@ -68,7 +68,7 @@ def load_commands(self):
6868 params = self .get_command_params (command_function )
6969 # Store the module along with the function name
7070 commands .append (
71- (command_name , module , command_function .__name__ , params )
71+ (command_name , getattr ( module , module_name ) , command_function .__name__ , params )
7272 )
7373 # Return the commands list
7474 return commands
@@ -85,7 +85,7 @@ def get_command_params(self, func):
8585
8686 def find_command (self , command_name : str ):
8787 for name , module , function_name , params in self .commands :
88- if name == command_name :
88+ if function_name == command_name :
8989 command_function = getattr (module , function_name )
9090 return command_function , params
9191 return None , None
@@ -102,5 +102,5 @@ def execute_command(self, command_name: str, command_args: dict):
102102 for name , value in command_args .items ():
103103 if name in params :
104104 params [name ] = value
105- output = command_function (** params )
105+ output = command_function (self , ** params )
106106 return output
0 commit comments