Commit d60cb676 authored by Penom Nom's avatar Penom Nom
Browse files

No commit message

No commit message
parent b4353a86
......@@ -92,19 +92,22 @@ def get_directories_structure_and_content(ng6_username, data_folder, output_fold
project_name = "Project_%s.%s" % ( re.sub( r"[\s\/]", "_", run['project_name']), run['project_id'] )
run_name = "Run_%s.%s" %( run['name'].replace(' ', '_').replace('/', '_'), id )
raw_data_dir = os.path.join( output_folder, project_name, run_name, "RawData" )
if source_dir not in src_directories :
src_directories.append(source_dir)
dest_directories.append(os.path.join( output_folder, project_name, run_name, "RawData" ))
if raw_data_dir not in dest_directories :
dest_directories.append(raw_data_dir)
if prefix == "run" :
for analyse_id, analyse_values in t3mysql.get_user_run_analysis(user_id, id, 'tx_nG6_analyze.name').items() :
analysis_dir = data_folder + '/' + analyse_values["directory"]
analysis_name = "Analyse_%s.%s"%( re.sub( r"[\s\/]", "_", analyse_values['name']), analyse_id )
dest_analysis_dir = os.path.join( output_folder, project_name, run_name, analysis_name )
if analysis_dir not in src_directories :
src_directories.append(analysis_dir)
dest_directories.append(os.path.join( output_folder, project_name, run_name, analysis_name ))
if dest_analysis_dir not in dest_directories :
dest_directories.append(dest_analysis_dir)
elif prefix == "analyse" :
analyse = t3mysql.select_analysis_informations(id)
......@@ -119,11 +122,15 @@ def get_directories_structure_and_content(ng6_username, data_folder, output_fold
if analyse["run_id"]:
run_name = "Run_%s.%s" % ( re.sub( r"[\s\/]", "_", analyse["run_name"]), analyse["run_id"])
analysis_name = "Analyse_%s.%s" % ( re.sub( r"[\s\/]", "_", analyse["name"]), id)
dest_directories.append(os.path.join( output_folder, project_name, run_name, analysis_name ))
dest_analysis_dir = os.path.join( output_folder, project_name, run_name, analysis_name )
if dest_analysis_dir not in dest_directories :
dest_directories.append(dest_analysis_dir)
# it's a project analysis
else :
analysis_name = "Project_analyses/%s.%s" % ( re.sub( r"[\s\/]", "_", analyse["name"]), id)
dest_directories.append(os.path.join( output_folder, project_name, analysis_name ))
dest_analysis_dir = os.path.join( output_folder, project_name, analysis_name )
if dest_analysis_dir not in dest_directories :
dest_directories.append(dest_analysis_dir)
if len(src_directories) != len(dest_directories) :
raise Exception("Error while retrieveing directory structure and content")
......
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