Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
ng6
Commits
4b735bf7
Commit
4b735bf7
authored
Nov 26, 2012
by
Jerome Mariette
Browse files
add commit lines
parent
fb81d857
Changes
1
Hide whitespace changes
Inline
Side-by-side
ng6/t3MySQLdb.py
View file @
4b735bf7
...
...
@@ -90,16 +90,14 @@ class t3MySQLdb(object):
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
)
+
"')"
print
req
curs
.
execute
(
req
)
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
)
+
"')"
curs
.
execute
(
req
)
else
:
raise
Exception
(
't3MySQLdb'
,
'The administration login is required.'
)
conn
.
commit
()
curs
.
close
()
conn
.
close
()
return
project_id
...
...
@@ -198,6 +196,7 @@ class t3MySQLdb(object):
req
=
"SELECT directory FROM tx_nG6_run WHERE uid="
+
str
(
run_id
)
curs
.
execute
(
req
)
run_directory
=
curs
.
fetchone
()
conn
.
commit
()
curs
.
close
()
conn
.
close
()
if
(
str
(
run_directory
[
0
])
!=
str
(
directory
)
):
...
...
@@ -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
+=
"','"
+
str
(
crdate
)
+
"','"
+
str
(
project_id
)
+
"','"
+
str
(
run_id
)
+
"')"
curs
.
execute
(
req
)
conn
.
commit
()
curs
.
close
()
conn
.
close
()
...
...
@@ -302,7 +302,7 @@ class t3MySQLdb(object):
req
+=
"sequencer='"
+
sequencer
.
replace
(
"'"
,
"
\'
"
)
+
"', "
req
=
req
[:
-
1
]
#remove last comma for WHERE
req
+=
"WHERE uid = '"
+
str
(
run_id
)
+
"'"
print
req
conn
.
commit
()
curs
.
execute
(
req
)
conn
.
close
()
...
...
@@ -348,6 +348,7 @@ class t3MySQLdb(object):
req
=
"SELECT pid FROM tx_nG6_sample WHERE uid="
+
str
(
sample_id
)
curs
.
execute
(
req
)
sample_pid
=
curs
.
fetchone
()
conn
.
commit
()
curs
.
close
()
conn
.
close
()
if
(
str
(
sample_pid
[
0
])
!=
str
(
self
.
cfg_reader
.
get_pid
())
):
...
...
@@ -406,6 +407,7 @@ class t3MySQLdb(object):
req
=
"SELECT directory FROM tx_nG6_analyze WHERE uid="
+
str
(
analyze_id
)
curs
.
execute
(
req
)
analyze_directory
=
curs
.
fetchone
()
conn
.
commit
()
curs
.
close
()
conn
.
close
()
if
(
str
(
analyze_directory
[
0
])
!=
str
(
directory
)
):
...
...
@@ -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
+=
"','"
+
str
(
crdate
)
+
"','"
+
str
(
project_id
)
+
"','"
+
str
(
analyze_id
)
+
"')"
curs
.
execute
(
req
)
conn
.
commit
()
curs
.
close
()
conn
.
close
()
...
...
@@ -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
+=
"','"
+
str
(
crdate
)
+
"','"
+
str
(
run_id
)
+
"','"
+
str
(
analyze_id
)
+
"')"
curs
.
execute
(
req
)
conn
.
commit
()
curs
.
close
()
conn
.
close
()
...
...
@@ -464,6 +468,7 @@ class t3MySQLdb(object):
req
+=
"','"
+
str
(
crdate
)
+
"','"
+
str
(
analyze_id
)
+
"','"
+
file
req
+=
"','"
+
str
(
key
)
+
"','"
+
str
(
value
)
+
"','"
+
str
(
group
)
+
"')"
curs
.
execute
(
req
)
conn
.
commit
()
curs
.
close
()
conn
.
close
()
...
...
@@ -481,6 +486,7 @@ class t3MySQLdb(object):
req
+=
"SET "
+
field
+
"='"
+
str
(
value
).
replace
(
"'"
,
"
\'
"
)
+
"' "
req
+=
"WHERE uid = '"
+
str
(
analyze_id
)
+
"'"
curs
.
execute
(
req
)
conn
.
commit
()
curs
.
close
()
conn
.
close
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment