comparison main.py @ 3:d2be2eb8350f draft

"planemo upload commit b2a00d9c24285fef0fb131d1832ecf4c337e5038-dirty"
author rhohensinner
date Mon, 19 Jul 2021 13:11:45 +0000
parents 0641ea2f75b1
children
comparison
equal deleted inserted replaced
2:0641ea2f75b1 3:d2be2eb8350f
2 ___created___ = "04.02.2021" 2 ___created___ = "04.02.2021"
3 ___last_modified___ = "20.05.2021" 3 ___last_modified___ = "20.05.2021"
4 4
5 # general imports 5 # general imports
6 import os, sys, json 6 import os, sys, json
7 import irods_upload
8 7
9 from shutil import copyfile 8 from shutil import copyfile
10 from datetime import datetime 9 from datetime import datetime
11 10
12 # irods-client imports 11 # irods-client imports
22 file_path_list = [] 21 file_path_list = []
23 selected_file = "" 22 selected_file = ""
24 session_success = False 23 session_success = False
25 selection_success = False 24 selection_success = False
26 iRODSCredentials = {"host": "", "port": "", "user": "", "pw": "", "zone": ""} 25 iRODSCredentials = {"host": "", "port": "", "user": "", "pw": "", "zone": ""}
26 python_path = []
27 27
28 28
29 ######################################################################################################################## 29 ########################################################################################################################
30 # Main function of the iRODS tools 30 # Main function of the iRODS tools
31 # 31 #
438 python_command = params["galaxy_root"] + "/tools/data_source/upload.py" 438 python_command = params["galaxy_root"] + "/tools/data_source/upload.py"
439 arg1 = params["galaxy_root"] 439 arg1 = params["galaxy_root"]
440 arg2 = params["galaxy_datatypes"] 440 arg2 = params["galaxy_datatypes"]
441 arg3 = os.path.abspath(fileParams.name) 441 arg3 = os.path.abspath(fileParams.name)
442 arg4 = params["job_id"] + ":" + params["out_dir"] + ":" + params["out_file"] 442 arg4 = params["job_id"] + ":" + params["out_dir"] + ":" + params["out_file"]
443 arg5 = params["galaxy_root"] + "/lib/galaxy"
443 444
444 # copy sample registry.xml to working directory 445 # copy sample registry.xml to working directory
445 copyfile(reg_file, params["galaxy_datatypes"]) 446 copyfile(reg_file, params["galaxy_datatypes"])
446 447
447 # activate environment for new process call and call the python upload command either both with 448 # activate environment for new process call and call the python upload command either both with
458 if upload_file != "": 459 if upload_file != "":
459 break 460 break
460 if upload_file != "": 461 if upload_file != "":
461 break 462 break
462 463
463 os.system("python " + upload_file + " " + arg1 + " " + arg2 + " " + arg3 + " " + arg4) 464 global python_path
465 python_path = sys.path
466 os.system(params["galaxy_root"] + "/.venv/bin/python " + upload_file + " " + arg1 + " " + arg2 + " " + arg3 + " " + arg4)
464 # close connection 467 # close connection
465 session.cleanup() 468 session.cleanup()
466 # -------------------------------------------------------------------------------------------------------------------- # 469 # -------------------------------------------------------------------------------------------------------------------- #
467 470
468 471