diff --git a/AbstractModule.py b/AbstractModule.py new file mode 100644 index 0000000..fed48da --- /dev/null +++ b/AbstractModule.py @@ -0,0 +1,16 @@ +from abc import ABC, abstractmethod + + +class AbstractModule(ABC): + """docstring for Module.""" + + def __init__(self): + super(AbstractModule, self).__init__() + + @abstractmethod + def get_command(self): + pass + + @abstractmethod + def run(self): + pass diff --git a/IModule.py b/IModule.py deleted file mode 100644 index bdc3bbb..0000000 --- a/IModule.py +++ /dev/null @@ -1,8 +0,0 @@ -class IModule(object): - """docstring for Module.""" - - def __init__(self): - super(IModule, self).__init__() - - def get_command(self): - raise NotImplementedError diff --git a/modules/sample/sampleModule.py b/modules/sample/sampleModule.py index 5fdd363..34e81e3 100644 --- a/modules/sample/sampleModule.py +++ b/modules/sample/sampleModule.py @@ -1,12 +1,15 @@ -from IModule import IModule +from AbstractModule import AbstractModule -class SampleModule(IModule): +class SampleModule(AbstractModule): """docstring for SampleModule.""" def __init__(self): super(SampleModule, self).__init__() + def run(self): + pass + def get_command(self): return [ "command 1",