コード例 #1
0
ファイル: sits.py プロジェクト: marceloperini/mdc
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)
コード例 #2
0
	def __initBus(self):
		self.bus = loader.getBus()
		self.bus.subscribe(self.subcribe_channel)