module.py 408 Bytes
from abc import ABCMeta, abstractmethod

class Module(object):
    __metaclass__ = ABCMeta

    name = ""
    description = ""
    vars = {}
    requiredVars = []

    @abstractmethod
    def run(self):
        pass

    def getVars(self):
        for var in self.requiredVars:
            modvar = __import__(var).getInstance(self.name)
            modvar.query()
            self.vars[modvar.name] = modvar