示例#1
0
    def __init__(self, configfile):
        """ Constructor. """
        BaseObject.__init__(self)
        self.name("OAPresentation")
        self.version("1.0")

        # Build configuration
        self.config = Configuration(configfile)

        # Create presenter
        self.presenter = Presenter(self.config)

        # Default output function
        self.outfunc = lambda data, params: True
        self.resetfunc = lambda flags: [False for k in flags]

        # Load output function
        try:
            # Import module
            __import__(self.config.output["present"]["module"])
            # Create object
            outclass = getattr(
                sys.modules[self.config.output["present"]["module"]], self.config.output["present"]["class"]
            )
            self.out = outclass(self.config.output["present"]["parameters"])
            self.outfunc = self.out.output
            self.resetfunc = self.out.reset

        except Exception as e:
            self.logger.error("[%s] Error loading the output function (Error: %s)", self.name(), e, exc_info=True)
示例#2
0
 def __init__(self):
     BaseObject.__init__(self)
     self.name("OAPresent")
     self.oa_presenter = OAPresentation(CONFIG_FILE)
示例#3
0
 def __init__(self):
     BaseObject.__init__(self)
     self.name("OASingle")
     self.version("1.0")
     self.oa = OA(CONFIG_FILE)