def init(self, core): Component.init(self, core) self.core = core vardir = core.config.get('CORE', 'vardir') sw_version = self._get_sw_version() filename = join(vardir, 'licence.txt') try: with open(filename, 'r') as fd: for line in fd.readlines(): split = line.split() key = split[0] try: value = " ".join(split[1:]) except IndexError: self.fail("check %s" % filename) self.values[key] = value except IOError, err: #TODO: reenable this #self.fail("could not read %s" % filename) #TODO: remove this self.values = { "sw_version": sw_version, } if EDENWALL: self.values.update( { "client": "Client not specified", "model": "EW4", "type": "EW4", # For compatibility with old EAS. "hw_version": "4.2.1", "serial": "000000000000000" } )
def init(self, core): Component.init(self, core) self.core = core self.createSubscriptions() self.read_config(None)