Commit 4b735bf7 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

add commit lines

parent fb81d857
...@@ -90,16 +90,14 @@ class t3MySQLdb(object): ...@@ -90,16 +90,14 @@ class t3MySQLdb(object):
raise Exception('t3MySQLdb', 'The administration value does not exist in the fe_rights_levels table.') raise Exception('t3MySQLdb', 'The administration value does not exist in the fe_rights_levels table.')
req = "INSERT INTO tx_nG6_project (pid, tstamp, crdate, description, name, hidden) VALUES ('" + str(self.cfg_reader.get_pid()) + "','" + str(crdate) + "','" + str(crdate) + "','" + pdescription.replace("'", "\'") + "','" + name.replace("'", "\'") + "','" + str(hidden) + "')" req = "INSERT INTO tx_nG6_project (pid, tstamp, crdate, description, name, hidden) VALUES ('" + str(self.cfg_reader.get_pid()) + "','" + str(crdate) + "','" + str(crdate) + "','" + pdescription.replace("'", "\'") + "','" + name.replace("'", "\'") + "','" + str(hidden) + "')"
print req
curs.execute(req) curs.execute(req)
project_id = conn.insert_id() project_id = conn.insert_id()
print project_id
req = "INSERT INTO fe_rights (fe_user_id, project_id, right_id) VALUES ('" + str(admin_id) + "','" + str(project_id) + "','" + str(right_level_id) + "')" req = "INSERT INTO fe_rights (fe_user_id, project_id, right_id) VALUES ('" + str(admin_id) + "','" + str(project_id) + "','" + str(right_level_id) + "')"
curs.execute(req) curs.execute(req)
else : else :
raise Exception('t3MySQLdb', 'The administration login is required.') raise Exception('t3MySQLdb', 'The administration login is required.')
conn.commit()
curs.close() curs.close()
conn.close() conn.close()
return project_id return project_id
...@@ -198,6 +196,7 @@ class t3MySQLdb(object): ...@@ -198,6 +196,7 @@ class t3MySQLdb(object):
req = "SELECT directory FROM tx_nG6_run WHERE uid=" + str(run_id) req = "SELECT directory FROM tx_nG6_run WHERE uid=" + str(run_id)
curs.execute(req) curs.execute(req)
run_directory = curs.fetchone() run_directory = curs.fetchone()
conn.commit()
curs.close() curs.close()
conn.close() conn.close()
if( str(run_directory[0]) != str(directory) ): if( str(run_directory[0]) != str(directory) ):
...@@ -218,6 +217,7 @@ class t3MySQLdb(object): ...@@ -218,6 +217,7 @@ class t3MySQLdb(object):
req = "INSERT INTO tx_nG6_project_run (pid, tstamp, crdate, project_id, run_id) VALUES('" + str(self.cfg_reader.get_pid()) + "','" + str(crdate) req = "INSERT INTO tx_nG6_project_run (pid, tstamp, crdate, project_id, run_id) VALUES('" + str(self.cfg_reader.get_pid()) + "','" + str(crdate)
req += "','" + str(crdate) + "','" + str(project_id) + "','" + str(run_id) + "')" req += "','" + str(crdate) + "','" + str(project_id) + "','" + str(run_id) + "')"
curs.execute(req) curs.execute(req)
conn.commit()
curs.close() curs.close()
conn.close() conn.close()
...@@ -302,7 +302,7 @@ class t3MySQLdb(object): ...@@ -302,7 +302,7 @@ class t3MySQLdb(object):
req += "sequencer='" + sequencer.replace("'", "\'") + "', " req += "sequencer='" + sequencer.replace("'", "\'") + "', "
req = req[:-1] #remove last comma for WHERE req = req[:-1] #remove last comma for WHERE
req += "WHERE uid = '"+ str(run_id) + "'" req += "WHERE uid = '"+ str(run_id) + "'"
print req conn.commit()
curs.execute(req) curs.execute(req)
conn.close() conn.close()
...@@ -348,6 +348,7 @@ class t3MySQLdb(object): ...@@ -348,6 +348,7 @@ class t3MySQLdb(object):
req = "SELECT pid FROM tx_nG6_sample WHERE uid=" + str(sample_id) req = "SELECT pid FROM tx_nG6_sample WHERE uid=" + str(sample_id)
curs.execute(req) curs.execute(req)
sample_pid = curs.fetchone() sample_pid = curs.fetchone()
conn.commit()
curs.close() curs.close()
conn.close() conn.close()
if( str(sample_pid[0]) != str(self.cfg_reader.get_pid()) ): if( str(sample_pid[0]) != str(self.cfg_reader.get_pid()) ):
...@@ -406,6 +407,7 @@ class t3MySQLdb(object): ...@@ -406,6 +407,7 @@ class t3MySQLdb(object):
req = "SELECT directory FROM tx_nG6_analyze WHERE uid=" + str(analyze_id) req = "SELECT directory FROM tx_nG6_analyze WHERE uid=" + str(analyze_id)
curs.execute(req) curs.execute(req)
analyze_directory = curs.fetchone() analyze_directory = curs.fetchone()
conn.commit()
curs.close() curs.close()
conn.close() conn.close()
if( str(analyze_directory[0]) != str(directory) ): if( str(analyze_directory[0]) != str(directory) ):
...@@ -426,6 +428,7 @@ class t3MySQLdb(object): ...@@ -426,6 +428,7 @@ class t3MySQLdb(object):
req = "INSERT INTO tx_nG6_project_analyze (pid, tstamp, crdate, project_id, analyze_id) VALUES('" + str(self.cfg_reader.get_pid()) + "','" + str(crdate) req = "INSERT INTO tx_nG6_project_analyze (pid, tstamp, crdate, project_id, analyze_id) VALUES('" + str(self.cfg_reader.get_pid()) + "','" + str(crdate)
req += "','" + str(crdate) + "','" + str(project_id) + "','" + str(analyze_id) + "')" req += "','" + str(crdate) + "','" + str(project_id) + "','" + str(analyze_id) + "')"
curs.execute(req) curs.execute(req)
conn.commit()
curs.close() curs.close()
conn.close() conn.close()
...@@ -442,6 +445,7 @@ class t3MySQLdb(object): ...@@ -442,6 +445,7 @@ class t3MySQLdb(object):
req = "INSERT INTO tx_nG6_run_analyze (pid, tstamp, crdate, run_id, analyze_id) VALUES('" + str(self.cfg_reader.get_pid()) + "','" + str(crdate) req = "INSERT INTO tx_nG6_run_analyze (pid, tstamp, crdate, run_id, analyze_id) VALUES('" + str(self.cfg_reader.get_pid()) + "','" + str(crdate)
req += "','" + str(crdate) + "','" + str(run_id) + "','" + str(analyze_id) + "')" req += "','" + str(crdate) + "','" + str(run_id) + "','" + str(analyze_id) + "')"
curs.execute(req) curs.execute(req)
conn.commit()
curs.close() curs.close()
conn.close() conn.close()
...@@ -464,6 +468,7 @@ class t3MySQLdb(object): ...@@ -464,6 +468,7 @@ class t3MySQLdb(object):
req += "','" + str(crdate) + "','" + str(analyze_id) + "','" + file req += "','" + str(crdate) + "','" + str(analyze_id) + "','" + file
req += "','" + str(key) + "','" + str(value) + "','" + str(group) + "')" req += "','" + str(key) + "','" + str(value) + "','" + str(group) + "')"
curs.execute(req) curs.execute(req)
conn.commit()
curs.close() curs.close()
conn.close() conn.close()
...@@ -481,6 +486,7 @@ class t3MySQLdb(object): ...@@ -481,6 +486,7 @@ class t3MySQLdb(object):
req += "SET " + field + "='" + str(value).replace("'", "\'") + "' " req += "SET " + field + "='" + str(value).replace("'", "\'") + "' "
req += "WHERE uid = '"+ str(analyze_id) + "'" req += "WHERE uid = '"+ str(analyze_id) + "'"
curs.execute(req) curs.execute(req)
conn.commit()
curs.close() curs.close()
conn.close() conn.close()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment