本文整理汇总了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):