def main(): argDict = mapDict(argv, usage) if "-d" in argDict and "-p" in argDict and "-r" in argDict \ and "-s" in argDict and "-e" in argDict: datasourceName = argDict["-d"].capitalize() productName = argDict["-p"] region = argDict["-r"] start = argDict["-s"] end = argDict["-e"] datasourceConfig = { "productName": productName , "region": region , "start": start , "end": end } bus = loader.getBus() datasource = loader.getDatasource(datasourceName,datasourceConfig) for message in datasource.generateMessages(): bus.publishMessage(datasourceName, message) else: exit(usage)
def __initBus(self): self.bus = loader.getBus() self.bus.subscribe(self.subcribe_channel)