Renaming of functions

Autoformatting
This commit is contained in:
Marcel Schwarz 2019-12-14 04:26:02 +01:00
parent 03005113b2
commit e8197d5cea
5 changed files with 9 additions and 9 deletions

View File

@ -15,4 +15,4 @@ class CommandRunnerDebug(object):
def run(self, module):
print("DEBUG RUNNER")
print(module.getCommand())
print(module.get_command())

View File

@ -4,5 +4,5 @@ class IModule(object):
def __init__(self):
super(IModule, self).__init__()
def getCommand(self):
def get_command(self):
raise NotImplementedError

View File

@ -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
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

View File

@ -1,5 +1,5 @@
from .sampleModule import SampleModule
def getModule():
def get_module():
return SampleModule()

View File

@ -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"