def init_class_cache(self): Datasource.init_classes(self.classes_path) logger.debug("init Datasource classes (%d)" % len(Datasource.class_factory)) Datarecipient.init_classes(self.classes_path) logger.debug("init Datarecipient classes (%d)" % len(Datarecipient.class_factory)) Application.init_classes(self.classes_path) logger.debug("init Application classes (%d)" % len(Application.class_factory)) MonitoringDetail.init_classes(self.classes_path) logger.debug("init MonitoringDetail classes (%d)" % len(MonitoringDetail.class_factory))
def add_datarecipient(self, **kwargs): for key in [k for k in kwargs.iterkeys() if isinstance(kwargs[k], str)]: kwargs[key] = re.sub('%.*?%', substenv, kwargs[key]) newcls = Datarecipient.get_class(kwargs) if newcls: datarecipient = newcls(**kwargs) self.datarecipients.append(datarecipient)