Renaming of functions
Autoformatting
This commit is contained in:
parent
03005113b2
commit
e8197d5cea
@ -15,4 +15,4 @@ class CommandRunnerDebug(object):
|
||||
|
||||
def run(self, module):
|
||||
print("DEBUG RUNNER")
|
||||
print(module.getCommand())
|
||||
print(module.get_command())
|
||||
|
@ -4,5 +4,5 @@ class IModule(object):
|
||||
def __init__(self):
|
||||
super(IModule, self).__init__()
|
||||
|
||||
def getCommand(self):
|
||||
def get_command(self):
|
||||
raise NotImplementedError
|
||||
|
8
main.py
8
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
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
from .sampleModule import SampleModule
|
||||
|
||||
|
||||
def getModule():
|
||||
def get_module():
|
||||
return SampleModule()
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user