当前位置: 首页>>代码示例>>Python>>正文


Python JobManager.addJobsFromDb方法代码示例

本文整理汇总了Python中JobManager.addJobsFromDb方法的典型用法代码示例。如果您正苦于以下问题:Python JobManager.addJobsFromDb方法的具体用法?Python JobManager.addJobsFromDb怎么用?Python JobManager.addJobsFromDb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JobManager的用法示例。


在下文中一共展示了JobManager.addJobsFromDb方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import JobManager [as 别名]
# 或者: from JobManager import addJobsFromDb [as 别名]

#.........这里部分代码省略.........

		cursor.execute('select run, jobconfiguration, batchid, status, validation, rawpath, jobstart, jobend from JOBSTATUS where validation="WAITING" OR ((validation="YES" OR validation="NONE") AND status<>"DONE")')
		for row in cursor:

			if row[1] in self.jobConfigurationList.keys():
				jobInfo = JobInformation()

				jobInfo.runNumber = row[0]
				jobInfo.jobConfiguration = self.jobConfigurationList[row[1]]
				jobInfo.batchid = row[2]
				jobInfo.status = row[3]
				jobInfo.validation = row[4]
				jobInfo.rawPath = row[5]
				jobInfo.jobStart = row[6]
				jobInfo.jobEnd = row[7]
				jobInfo.dbConnection = self.dbConnection

				self.loadJobConfigModule(jobInfo)

				self.jobInformationList.append(jobInfo)


#		for jobInfo in self.jobInformationList:
#			print jobInfo

		connection.close()

		#send list of jobs not NEW to jobManager
		jobList = []
		for jobInfo in self.jobInformationList:
			if jobInfo.status!='NEW':
				jobList.append(jobInfo)

		self.jobManager.addJobsFromDb(jobList)
		return

	def newJobsFromDb(self):
		jobList = []

		connection = self.getDbConnection()
		cursor = connection.cursor()

		cursor.execute('select run, jobconfiguration, batchid, status, validation, rawpath, jobstart, jobend from JOBSTATUS where validation="WAITING" OR ((validation="YES" OR validation="NONE") AND status<>"DONE")')
		for row in cursor:

			if row[1] in self.jobConfigurationList.keys():
				jobInfo = JobInformation()

				jobInfo.runNumber = row[0]
				jobInfo.jobConfiguration = self.jobConfigurationList[row[1]]
				jobInfo.batchid = row[2]
				jobInfo.status = row[3]
				jobInfo.validation = row[4]
				jobInfo.rawPath = row[5]
				jobInfo.jobStart = row[6]
				jobInfo.jobEnd = row[7]
				jobInfo.dbConnection = self.dbConnection

				self.loadJobConfigModule(jobInfo)

				jobList.append(jobInfo)

		return jobList

	def updateJobInformationList(self):
开发者ID:l1calo,项目名称:TrigT1CaloCAF,代码行数:69,代码来源:JobOrganizer.py


注:本文中的JobManager.addJobsFromDb方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。