def listwrapper(self): r = JOb() c = 0 r.wrappers = [] for w in self.rm.wrappers: sd = w.getSensorDescription() if isinstance(sd, list): for _sd in sd: r.wrappers.append(JOb()) r.wrappers[c].information = _sd.information r.wrappers[c].uuid = _sd.uuid r.wrappers[c].sensorName = _sd.sensorName r.wrappers[c].author = _sd.author r.wrappers[c].sensorID = _sd.sensorID r.wrappers[c].fullSensorID = _sd.fullSensorID r.wrappers[c].source = _sd.source r.wrappers[c].sensorType = _sd.sensorType r.wrappers[c].sourceFormat = _sd.sourceFormat r.wrappers[c].messagebus.routingKey = _sd.messagebus.routingKey c += 1 else: r.wrappers.append(JOb()) r.wrappers[c].information = sd.information r.wrappers[c].uuid = sd.uuid r.wrappers[c].sensorName = sd.sensorName r.wrappers[c].author = sd.author r.wrappers[c].sensorID = sd.sensorID r.wrappers[c].fullSensorID = sd.fullSensorID r.wrappers[c].source = sd.source r.wrappers[c].sensorType = sd.sensorType r.wrappers[c].sourceFormat = sd.sourceFormat r.wrappers[c].messagebus.routingKey = sd.messagebus.routingKey c += 1 return r.dumps()
def listwrapperfull(self): r = JOb() r.wrappers = [] for w in self.rm.wrappers: sd = w.getSensorDescription() if isinstance(sd, list): for _sd in sd: r.wrappers.append(_sd) else: r.wrappers.append(sd) return r.dumps()