Blame view

modules/module.py 461 Bytes
1
2
3
4
5
6
7
from abc import ABCMeta, abstractmethod

class Module(object):
    __metaclass__ = ABCMeta

    name = ""
    description = ""
8
9
    vars = {}
    requiredVars = []
10
11

    @abstractmethod
Imanol-Mikel Barba Sabariego authored
12
    def execute(self):
13
14
15
        pass

    def getVars(self):
16
17
        for var in self.requiredVars:
            modvar = __import__(var).getInstance(self.name)
18
            modvar.query()
19
20
21
22
            self.vars[modvar.name] = modvar

    def __str__(self):
        return self.name