def getConfigOption(self, key, defaultValue = None): """ Returns configuration option by its key @param key: Configuration key @param defaultValue: Default value if key is not found @return: mixed """ if conf.has_section('settings'): section = conf['settings'] return section.get(key, defaultValue) return defaultValue
def initialization(self): """ Initialization of the handler @return: """ super(AtrackHandler, self).initialization() config = {} if conf.has_section("settings"): section = conf["settings"] for key in section.keys(): config[key] = section[key] self._packetsFactory = packets.PacketFactory(config)