From e1e3549e53b67dd569891e1bae7e7e394ebcf5e2 Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Sat, 14 Dec 2019 04:11:12 +0100 Subject: [PATCH] Create RealRunner and DebugRunner and Module Interface --- CommandRunner.py | 18 ++++++++++++++++++ IModule.py | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 CommandRunner.py create mode 100644 IModule.py diff --git a/CommandRunner.py b/CommandRunner.py new file mode 100644 index 0000000..aee3dff --- /dev/null +++ b/CommandRunner.py @@ -0,0 +1,18 @@ +class CommandRunner(object): + """docstring for CommandRunner.""" + + def __init__(self): + super(CommandRunner).__init__() + + def run(self, module): + print("REAL RUNNER") + print("Commands should be executed as subprocess.") + + +class CommandRunnerDebug(object): + def __init__(self): + super(CommandRunnerDebug).__init__() + + def run(self, module): + print("DEBUG RUNNER") + print(module.getCommand()) diff --git a/IModule.py b/IModule.py new file mode 100644 index 0000000..377854d --- /dev/null +++ b/IModule.py @@ -0,0 +1,8 @@ +class IModule(object): + """docstring for Module.""" + + def __init__(self): + super(IModule, self).__init__() + + def getCommand(self): + raise NotImplementedError