sql_get_new_job="SELECT jobs.id,parametersJSON,directory,email,tool,jobs.idGenerator,outputFormat,command from jobs inner join generators on jobs.idGenerator=generators.id where status='10'"
sql_get_new_job="SELECT jobs.id,parametersJSON,directory,email,tool,jobs.idGenerator,outputFormat,command from jobs inner join generators on jobs.idGenerator=generators.id where status='10'"
mycursor=database.cursor(buffered=True)
mycursor=database.cursor(buffered=True)
mycursor.execute(sql_get_new_job)
mycursor.execute(sql_get_new_job)
myresult=mycursor.fetchone()
myresult=mycursor.fetchone()
mycursor.close()
mycursor.close()
returnmyresult
returnmyresult
...
@@ -71,13 +70,13 @@ def get_job(database):
...
@@ -71,13 +70,13 @@ def get_job(database):
# Returns 1 if no other deamon selected the job first, 0 otherwwise.
# Returns 1 if no other deamon selected the job first, 0 otherwwise.
defapply_for_job(database,job_id:str):
defapply_for_job(database,job_id:str):
mycursor=database.cursor(buffered=False)
mycursor=database.cursor(buffered=False)
update="UPDATE jobs set status='100' where jobs.id='"+job_id+"' and status='10'"
update="UPDATE jobs set status='100' where jobs.id='"+job_id+"' and status='10'"
mycursor.execute(update)
mycursor.execute(update)
database.commit()
database.commit()
returnmycursor.rowcount
returnmycursor.rowcount
# Returns a dictionnary containing each generator's parameters as a key. The value associated to each key is "is this parameter's value written in the command line or in a separated file
# Returns a dictionnary containing each generator's parameters as a key. The value associated to each key is "is this parameter's value written in the comand line or in a separated file
sql_get_new_job="SELECT name,basefile,defaultValue from parameters inner join generators on parameters.idGenerator=generators.id where generators.tool = '"+generator+"'"
sql_get_new_job="SELECT name,basefile,defaultValue from parameters inner join generators on parameters.idGenerator=generators.id where generators.tool = '"+generator+"'"