Commit 2c4e618e authored by Romain Therville's avatar Romain Therville 🐭
Browse files

There was an error in analysis.py, line 155.

issue#124
parent 00b365f2
......@@ -143,14 +143,19 @@ class Analysis (Component):
logging.getLogger("Analysis.__init__").debug("tempfile.tempdir = " + tempfile.tempdir)
if not os.path.isdir(tempfile.tempdir):
os.makedirs(tempfile.tempdir, 0o751)
logging.getLogger("Analysis.__init__").debug("self.space_id = " + self.space_id)
if id != None : # If not a new analysis
logging.getLogger("Analysis.__init__").debug("Connexion à la BD")
t3mysql = t3MySQLdb()
logging.getLogger("Analysis.__init__").debug("Connexion effectuée")
self.run = Run.get_from_id(self.__get_run_id())
from ng6.project import Project
self.project = Project.get_from_run_id(self.__get_run_id())
if self.run != None :
self.project = Project.get_from_run_id(self.__get_run_id())
else :
self.project = Project.get_from_id(self.__get_project_id())
self.space_id=self.project.space_id
self.directory = t3mysql.select_analysis_directory(id)
logging.getLogger("Analysis.__init__").debug("Building analysis with id=" + str(id) + " [" + str(self) + "]")
......@@ -669,17 +674,17 @@ class Analysis (Component):
@param id : the analysis id
"""
logging.getLogger("Analysis.get_from_id").debug("Loading the analysis from id " + str(id))
try:
t3mysql = t3MySQLdb()
[name, date, description, software, options, version] = t3mysql.select_analysis(id)
my_analysis = Analysis(name, description, software, options, version, id)
if my_analysis == None:
logging.getLogger("Analysis.get_from_id").error("The analysis id=" + str(id) + " does not exists in the database.")
raise Exception("The analysis id=" + str(id) + " does not exists in the database.\n")
return my_analysis
except Exception as err:
logging.getLogger("Analysis.get_from_id").error("Error while loading the analysis from the database [" + str(err) + "]")
raise Exception("Error while loading the analysis from the database\n" + str(err))
#try:
t3mysql = t3MySQLdb()
[name, date, description, software, options, version] = t3mysql.select_analysis(id)
my_analysis = Analysis(name, description, software, options, version, id)
if my_analysis == None:
logging.getLogger("Analysis.get_from_id").error("The analysis id=" + str(id) + " does not exists in the database.")
raise Exception("The analysis id=" + str(id) + " does not exists in the database.\n")
return my_analysis
#except Exception as err:
# logging.getLogger("Analysis.qget_from_id").error("Error while loading the analysis from the database [" + str(err) + "]")
# raise Exception("Error while loading the analysis from the database\n" + str(err))
@staticmethod
......
Markdown is supported
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