Mercurial > repos > siwaa > erecord_file
annotate main_file.py @ 2:9e8f5f220917 draft
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
| author | siwaa |
|---|---|
| date | Thu, 15 Feb 2024 14:44:47 +0000 |
| parents | 27e7e4d38e44 |
| children | aa5c088856c8 |
| rev | line source |
|---|---|
|
0
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
1 # -*- coding: UTF-8 -*- |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
2 """ |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
3 main_file |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
4 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
5 Requests having as OUTput : 1 json data + maybe 1 more file (xls or zip) |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
6 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
7 Accepts actions (all) : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
8 'help' |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
9 'get_pkg_list' 'get_pkg_vpz_list' 'get_pkg_data_list' |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
10 'get_vpz_input' 'post_vpz_input' |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
11 'get_vpz_output' 'post_vpz_output' |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
12 'get_vpz_inout' 'post_vpz_inout' |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
13 'get_vpz_experiment' 'post_vpz_experiment' |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
14 'get_vpz_report_conditions' 'post_vpz_report_conditions' |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
15 'get_vpz_report' 'post_vpz_report' |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
16 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
17 Parameters (Inputs) : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
18 - '-action' parameter : action value (mandatory) |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
19 - '-data' parameter : data (JSON format) (optional) |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
20 - '-datafolder' parameter : datafolder file path (optional, |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
21 available only in some cases) |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
22 - '-experimentfile' parameter : experimentfile path (optional, |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
23 available only in some cases) : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
24 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
25 If there is an action value into data, then this one is ignored. |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
26 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
27 Outputs : |
|
2
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
28 - output.json data file (jsonoutput_filepath) |
|
0
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
29 - 1 other file in following cases : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
30 - experiment.xls file |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
31 if 'action' == get_vpz_experiment, post_vpz_experiment |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
32 - conditions.xls file |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
33 if 'action' == get_vpz_report_conditions, |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
34 post_vpz_report_conditions |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
35 - report.zip file |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
36 if 'action' == get_vpz_report, post_vpz_report |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
37 """ |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
38 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
39 MAIN_DEBUG=False # True for more information returned |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
40 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
41 import argparse |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
42 import json |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
43 import erecord.api.erecord as erecord_api |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
44 from erecord.api.cmn.views_mixins import ActionViewMixin |
|
2
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
45 from erecord.api.cmn.utils.errors import build_error_content |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
46 |
|
0
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
47 import os |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
48 import shutil |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
49 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
50 PM = "[main_file.py]" |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
51 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
52 r = dict() |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
53 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
54 import sys |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
55 if MAIN_DEBUG: r["sys.path"] = sys.path # debug |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
56 if MAIN_DEBUG: r["sys.argv"] = sys.argv # debug |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
57 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
58 data = dict() |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
59 json_response = dict() |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
60 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
61 try : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
62 parser = argparse.ArgumentParser() |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
63 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
64 # -action |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
65 available_action_list = ActionViewMixin.get_action_list() |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
66 htext = "action value among : " + str(available_action_list) |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
67 parser.add_argument("-action", default='help', help=htext, |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
68 choices=available_action_list) |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
69 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
70 # -data |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
71 parser.add_argument("-data", type=str, help="data json file path") |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
72 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
73 # -datafolder |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
74 htext = "datafolder file path, available for action : " |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
75 htext +="post_vpz_output, post_vpz_inout," |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
76 htext +="post_vpz_experiment, post_vpz_report" |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
77 parser.add_argument("-datafolder", type=str, help=htext) |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
78 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
79 # -experimentfile |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
80 htext = "experimentfile path, available for action : post_vpz_experiment" |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
81 parser.add_argument("-experimentfile", type=str, help=htext) |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
82 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
83 args = parser.parse_args() |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
84 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
85 if (args.action is None) or (args.action == 'None') : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
86 warn = "NO action given => enforced to 'help'" |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
87 r["warning"] = warn |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
88 action = 'help' # enforced (default) |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
89 else : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
90 action = args.action |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
91 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
92 if (args.data is None) or (args.data == 'None') : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
93 data = dict() # NO data (JSON format) given as argument |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
94 else : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
95 jsoninput_filename = args.data |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
96 inputfile = open(jsoninput_filename, 'r') |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
97 data = json.load(inputfile) # get data |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
98 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
99 if (args.datafolder is None) or (args.datafolder == 'None') : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
100 pass # NO datafolder given |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
101 else : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
102 data['datafolder'] = args.datafolder |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
103 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
104 if (args.experimentfile is None) or (args.experimentfile == 'None') : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
105 pass # NO experimentfile given |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
106 else : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
107 data['experimentfile'] = args.experimentfile |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
108 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
109 data['action'] = action |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
110 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
111 r["data"] = data |
|
2
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
112 |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
113 # default configuration + maybe some modifications |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
114 config = erecord_api.conf() # default (vle-2.0.0 version) |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
115 config.DB_add_vpz(vpz_id=1312, vpzname="wwdm.vpz", pkgname="wwdm") |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
116 if MAIN_DEBUG: r["config"] = config.get_as_dict() # debug |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
117 |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
118 r_init = erecord_api.init(config) |
|
0
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
119 if MAIN_DEBUG: r["init"] = r_init # debug |
|
2
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
120 |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
121 response = erecord_api.action(config, data) |
|
0
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
122 json_response = json.loads(response) |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
123 |
|
2
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
124 # Restitution : file (experiment.xls, conditions.xls, report.zip) |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
125 # Note : |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
126 # tool.xml command "touch" the file (in case of failed to be copied here) |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
127 # for it to exist (even if empty) => able to be found |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
128 if action in ['get_vpz_experiment', 'post_vpz_experiment', |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
129 'get_vpz_report_conditions', 'post_vpz_report_conditions', |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
130 'get_vpz_report', 'post_vpz_report']: |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
131 try: |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
132 filename = json_response["outputfile_name"] |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
133 outputfile_path = json_response["outputfile_path"] |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
134 shutil.copyfile(src=outputfile_path, |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
135 dst=os.path.join(config.out_path,filename)) |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
136 # tool.xml uses them |
|
0
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
137 |
|
2
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
138 if not MAIN_DEBUG: # some response information not kept |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
139 for k in ('outputfile_name', 'outputfile_path', 'zip_file_path'): |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
140 if k in json_response.keys(): del(json_response[k]) |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
141 |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
142 except Exception as e : |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
143 |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
144 msg = PM+"[second file " |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
145 if "outputfile_name" in json_response.keys() : |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
146 msg = "('"+ json_response["outputfile_name"] + "')" |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
147 msg = " restitution]" |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
148 cnt = build_error_content(exception=e, errormsg=msg) |
|
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
149 json_response["error PLUS"] = str(cnt) |
|
0
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
150 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
151 except Exception as e : |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
152 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
153 response = erecord_api.error_case(data=data, msg=PM, e=e) |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
154 json_response = json.loads(response) |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
155 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
156 r["response"] = json_response |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
157 |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
158 # Restitution : json file |
|
2
9e8f5f220917
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
siwaa
parents:
0
diff
changeset
|
159 jsonoutput_filepath = os.path.join(config.out_path, config.jsonoutput_filename) |
|
0
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
160 with open(jsonoutput_filepath, "w") as outfile: |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
161 json.dump(r, outfile) |
|
27e7e4d38e44
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 88beb443a737b4c4d42bb0011a26a0acf535c366
siwaa
parents:
diff
changeset
|
162 |
