Commit ac7c5ff7 authored by Romain Therville's avatar Romain Therville 🐭
Browse files

Fix for issue#86

parent 00b365f2
...@@ -377,9 +377,9 @@ class Utils(object): ...@@ -377,9 +377,9 @@ class Utils(object):
if prefix == "data" or prefix == "run" : if prefix == "data" or prefix == "run" :
run = t3mysql.select_run_informations(id) run = t3mysql.select_run_informations(id)
source_dir = data_folder +'/'+ run['directory'] source_dir = data_folder +'/'+ run['directory']
project_name = "Project_%s.%s" % ( re.sub( r"[\s\/]", "_", run['project_name']), run['project_id'] ) 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 )
run_name = "Run_%s.%s" %( run['name'].replace(' ', '_').replace('/', '_').replace('\\','_').replace('(','_').replace(')','_'), id )
raw_data_dir = os.path.join( output_folder, project_name, run_name, "RawData" ) raw_data_dir = os.path.join( output_folder, project_name, run_name, "RawData" )
if source_dir not in src_directories : if source_dir not in src_directories :
...@@ -392,6 +392,7 @@ class Utils(object): ...@@ -392,6 +392,7 @@ class Utils(object):
analysis_dir = data_folder + '/' + analyse_values["directory"] analysis_dir = data_folder + '/' + analyse_values["directory"]
analysis_name = "Analyse_%s.%s"%( re.sub( r"[\s\/]", "_", analyse_values['name']), analyse_id ) 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 ) dest_analysis_dir = os.path.join( output_folder, project_name, run_name, analysis_name )
if analysis_dir not in src_directories : if analysis_dir not in src_directories :
src_directories.append(analysis_dir) src_directories.append(analysis_dir)
if dest_analysis_dir not in dest_directories : if dest_analysis_dir not in dest_directories :
...@@ -429,7 +430,6 @@ class Utils(object): ...@@ -429,7 +430,6 @@ class Utils(object):
if os.path.isdir(e) : if os.path.isdir(e) :
sources.append(e) sources.append(e)
destinations.append(dest_directories[i]) destinations.append(dest_directories[i])
return sources, destinations return sources, destinations
......
...@@ -83,6 +83,7 @@ $(function () { ...@@ -83,6 +83,7 @@ $(function () {
}; };
var _retrieve_data = function(workflow_id, callback, error_callback){ var _retrieve_data = function(workflow_id, callback, error_callback){
console.log("IN _retrieve_data, workflow_id=" + workflow_id);
$.ajax({ $.ajax({
url : $("#server_url").val() + '/get_workflow_outputs?workflow_id=' + workflow_id, url : $("#server_url").val() + '/get_workflow_outputs?workflow_id=' + workflow_id,
dataType : 'jsonp', dataType : 'jsonp',
...@@ -159,15 +160,20 @@ $(function () { ...@@ -159,15 +160,20 @@ $(function () {
button = this; button = this;
button.disabled = true; button.disabled = true;
console.log("IN _retrieve_url_list, before _retrieve_data, step 1");
_get_workflow_status(running_wf.id , _get_workflow_status(running_wf.id ,
// successcb // successcb
function(statusdata){ function(statusdata){
if (statusdata.status == "completed"){ if (statusdata.status == "completed"){
console.log("IN _retrieve_url_list, before _retrieve_data, running_wf.id=" + running_wf.id);
_retrieve_data(running_wf.id, function(data){ _retrieve_data(running_wf.id, function(data){
$(button).hide(); $(button).hide();
$.each(data, function(i, component) { $.each(data, function(i, component) {
$.each(component, function(filename, file) { $.each(component, function(filename, file) {
if (filename == ufilename){ if (filename == ufilename){
console.log("IN _retrieve_url_list, before _display_file_content, step 2");
console.log("IN _retrieve_url_list, file.url="+file.url);
console.log("IN _retrieve_url_list, process_data="+process_data);
_display_file_content(file.url, modal.$body, process_data); _display_file_content(file.url, modal.$body, process_data);
} }
}); });
...@@ -286,6 +292,7 @@ $(function () { ...@@ -286,6 +292,7 @@ $(function () {
modal.$modal.modal(); modal.$modal.modal();
modal.$modal.find('#wfform').wfform(form_options); modal.$modal.find('#wfform').wfform(form_options);
modal.$modal.find('#wfform').on('run.wfform', function(event, running_wf) { modal.$modal.find('#wfform').on('run.wfform', function(event, running_wf) {
console.log("IN download_options, before _retrieve_url_list");
_retrieve_url_list(modal, running_wf, 'output_list.txt'); _retrieve_url_list(modal, running_wf, 'output_list.txt');
}); });
}, },
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
import os import os
import pickle import pickle
import logging
from jflow.component import Component from jflow.component import Component
from ng6.utils import Utils from ng6.utils import Utils
...@@ -27,6 +28,7 @@ def create_symbolik_link (ids_dump_path, output_list, user_script, username, pas ...@@ -27,6 +28,7 @@ def create_symbolik_link (ids_dump_path, output_list, user_script, username, pas
import os import os
import pickle import pickle
import subprocess import subprocess
import logging
from ng6.config_reader import NG6ConfigReader from ng6.config_reader import NG6ConfigReader
from ng6.utils import Utils, SSH from ng6.utils import Utils, SSH
...@@ -43,8 +45,10 @@ def create_symbolik_link (ids_dump_path, output_list, user_script, username, pas ...@@ -43,8 +45,10 @@ def create_symbolik_link (ids_dump_path, output_list, user_script, username, pas
prefixed_ids = pickle.load(fh) prefixed_ids = pickle.load(fh)
fh.close() fh.close()
prefixed_ids = ";".join(prefixed_ids) prefixed_ids = ";".join(prefixed_ids)
logging.getLogger("createsymlink").debug("Before Utils.get_directories_structure_and_content()")
src_directories, dest_directories = Utils.get_directories_structure_and_content(ng6_username, data_folder, output_folder, prefixed_ids) src_directories, dest_directories = Utils.get_directories_structure_and_content(ng6_username, data_folder, output_folder, prefixed_ids)
logging.getLogger("createsymlink").debug("src_directories = " + ",".join(src_directories))
logging.getLogger("createsymlink").debug("dest_directories = " + ",".join(dest_directories))
destinations = [] destinations = []
with open(user_script, "w") as us: with open(user_script, "w") as us:
......
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