Skip to content

Commit

Permalink
Fix the remaining issues in the command execution pipeline (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
gururise authored Apr 26, 2023
1 parent 40d6463 commit 0a12053
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def load_commands(self):
params = self.get_command_params(command_function)
# Store the module along with the function name
commands.append(
(command_name, module, command_function.__name__, params)
(command_name, getattr(module, module_name), command_function.__name__, params)
)
# Return the commands list
return commands
Expand All @@ -85,7 +85,7 @@ def get_command_params(self, func):

def find_command(self, command_name: str):
for name, module, function_name, params in self.commands:
if name == command_name:
if function_name == command_name:
command_function = getattr(module, function_name)
return command_function, params
return None, None
Expand All @@ -102,5 +102,5 @@ def execute_command(self, command_name: str, command_args: dict):
for name, value in command_args.items():
if name in params:
params[name] = value
output = command_function(**params)
output = command_function(self,**params)
return output

0 comments on commit 0a12053

Please sign in to comment.