diff --git a/CommandRunner.py b/CommandRunner.py index aee3dff..8249941 100644 --- a/CommandRunner.py +++ b/CommandRunner.py @@ -15,4 +15,4 @@ class CommandRunnerDebug(object): def run(self, module): print("DEBUG RUNNER") - print(module.getCommand()) + print(module.get_command()) diff --git a/IModule.py b/IModule.py index 377854d..bdc3bbb 100644 --- a/IModule.py +++ b/IModule.py @@ -4,5 +4,5 @@ class IModule(object): def __init__(self): super(IModule, self).__init__() - def getCommand(self): + def get_command(self): raise NotImplementedError diff --git a/main.py b/main.py index d9f4ae3..3b30b96 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,4 @@ -from CommandRunner import CommandRunner as Runner +from CommandRunner import CommandRunnerDebug as Runner import importlib import os @@ -6,14 +6,14 @@ import os def get_modules(): modules = [] for folder in os.listdir("./modules"): - #skipping sample module + # skipping sample module if folder == "sample": - continue - + continue + print("Module found: " + folder) curr_module = importlib.import_module('.' + folder, package="modules") print("Try to load module: " + folder) - modules.append(curr_module.getModule()) + modules.append(curr_module.get_module()) print("Module loaded successfully: " + folder) return modules diff --git a/modules/sample/__init__.py b/modules/sample/__init__.py index 80f166e..c1980aa 100644 --- a/modules/sample/__init__.py +++ b/modules/sample/__init__.py @@ -1,5 +1,5 @@ from .sampleModule import SampleModule -def getModule(): +def get_module(): return SampleModule() diff --git a/modules/sample/sampleModule.py b/modules/sample/sampleModule.py index 8b45a5d..5fdd363 100644 --- a/modules/sample/sampleModule.py +++ b/modules/sample/sampleModule.py @@ -7,7 +7,7 @@ class SampleModule(IModule): def __init__(self): super(SampleModule, self).__init__() - def getCommand(self): + def get_command(self): return [ "command 1", "command 2"