Mercurial > repos > iuc > data_manager_manual
annotate data_manager/data_manager_manual.py @ 2:1c1e228884d3 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
author | iuc |
---|---|
date | Mon, 23 Sep 2019 10:53:17 -0400 |
parents | 6524e573d9c2 |
children | 31f44a9f507e |
rev | line source |
---|---|
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
1 #!/usr/bin/env python |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
2 # Dan Blankenberg |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
3 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
4 import json |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
5 import logging |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
6 import optparse |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
7 import os |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
8 import shutil |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
9 import tempfile |
1
6524e573d9c2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9e376934d399042eabcd4129e23beda60917273d
iuc
parents:
0
diff
changeset
|
10 from xml.etree.ElementTree import tostring |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
11 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
12 try: |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
13 # For Python 3.0 and later |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
14 from shutil import unpack_archive |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
15 except ImportError: |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
16 # Fall back to Python 2 import |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
17 from setuptools.archive_util import unpack_archive |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
18 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
19 try: |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
20 # For Python 3.0 and later |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
21 from urllib.request import urlretrieve |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
22 from urllib.parse import urlsplit |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
23 except ImportError: |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
24 # Fall back to Python 2 imports |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
25 from urllib import urlretrieve |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
26 from urlparse import urlsplit |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
27 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
28 _log_name = __name__ |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
29 if _log_name == '__builtin__': |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
30 _log_name = 'toolshed.installed.manual.data.manager' |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
31 log = logging.getLogger(_log_name) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
32 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
33 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
34 # --- These methods are called by/within the Galaxy Application |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
35 def exec_before_job(app, inp_data, out_data, param_dict, tool=None, **kwd): |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
36 # Look for any data tables that haven't been defined for this data manager before and dynamically add them to Galaxy |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
37 param_dict = dict(**param_dict) |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
38 data_tables_param = param_dict.get('data_tables', []) |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
39 if not isinstance(data_tables_param, list): |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
40 data_tables_param = [data_tables_param] |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
41 if tool: |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
42 tool_shed_repository = tool.tool_shed_repository |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
43 else: |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
44 tool_shed_repository = None |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
45 tdtm = None |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
46 data_manager = app.data_managers.get_manager(tool.data_manager_id, None) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
47 for data_table_param in data_tables_param: |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
48 data_table_name = data_table_param.get('data_table_name') |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
49 if data_table_name: |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
50 # get data table managed by this data Manager |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
51 data_table = app.tool_data_tables.get_tables().get(data_table_name) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
52 if data_table: |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
53 data_table_filename = data_table.get_filename_for_source(data_manager, None) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
54 if not data_table_filename: |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
55 if tdtm is None: |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
56 from tool_shed.tools import data_table_manager |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
57 tdtm = data_table_manager.ToolDataTableManager(app) |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
58 target_dir, tool_path, relative_target_dir = tdtm.get_target_install_dir(tool_shed_repository) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
59 # Dynamically add this data table |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
60 log.debug("Attempting to dynamically create a missing Tool Data Table named %s." % data_table_name) |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
61 repo_info = tdtm.generate_repository_info_elem_from_repository(tool_shed_repository, parent_elem=None) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
62 if repo_info is not None: |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
63 repo_info = tostring(repo_info) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
64 tmp_file = tempfile.NamedTemporaryFile() |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
65 tmp_file.write(__get_new_xml_definition(app, data_table, data_manager, repo_info, target_dir)) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
66 tmp_file.flush() |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
67 app.tool_data_tables.add_new_entries_from_config_file(tmp_file.name, None, app.config.shed_tool_data_table_config, persist=True) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
68 tmp_file.close() |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
69 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
70 |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
71 def __get_new_xml_definition(app, data_table, data_manager, repo_info=None, location_file_dir=None): |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
72 sub_dict = {'table_name': data_table.name, 'comment_char': '', 'columns': '', 'file_path': ''} |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
73 sub_dict.update(data_manager.get_tool_shed_repository_info_dict()) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
74 if data_table.comment_char: |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
75 sub_dict['comment_char'] = 'comment_char="%s"' % (data_table.comment_char) |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
76 for i, name in enumerate(data_table.get_column_name_list()): |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
77 if name is not None: |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
78 sub_dict['columns'] = "%s\n%s" % (sub_dict['columns'], '<column name="%s" index="%s" />' % (name, i)) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
79 location_file_dir = location_file_dir or app.config.galaxy_data_manager_data_path |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
80 for filename in data_table.filenames.keys(): |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
81 sub_dict['file_path'] = os.path.basename(filename) |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
82 sub_dict['file_path'] = os.path.join(location_file_dir, sub_dict['file_path']) # os.path.abspath? |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
83 if not os.path.exists(sub_dict['file_path']): |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
84 # Create empty file |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
85 log.debug("Attempting to create a missing location file %s." % sub_dict['file_path']) |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
86 open(sub_dict['file_path'], 'wb+').close() |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
87 break |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
88 sub_dict['repo_info'] = repo_info or '' |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
89 return """ |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
90 <tables><table name="%(table_name)s" %(comment_char)s> |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
91 %(columns)s |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
92 <file path="%(file_path)s" /> |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
93 %(repo_info)s |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
94 </table></tables> |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
95 """ % sub_dict |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
96 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
97 |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
98 def galaxy_code_get_available_data_tables(trans): |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
99 # list of data tables |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
100 return [(x, x, False) for x in trans.app.tool_data_tables.get_tables().keys()] |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
101 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
102 |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
103 def galaxy_code_get_available_data_table_columns(trans, data_table_name): |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
104 return [(x, x, True) for x in trans.app.tool_data_tables.get(data_table_name).get_column_name_list()] |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
105 # --- End Galaxy called Methods --- |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
106 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
107 |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
108 def get_data_table_entries(params, galaxy_data_manager_data_path): |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
109 rval = {} |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
110 data_tables = params.get('data_tables', []) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
111 for data_table in data_tables: |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
112 entry_dict = {} |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
113 for column in data_table.get('columns', []): |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
114 value = column.get('data_table_column_value', '') |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
115 if column.get('is_path', {}).get('is_path_selector') == 'yes' and column.get('is_path', {}).get('abspath') == 'abspath': |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
116 value = os.path.abspath(os.path.join(galaxy_data_manager_data_path, value)) |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
117 entry_dict[column.get('data_table_column_name', '')] = value |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
118 data_table_name = data_table['data_table_name'] |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
119 rval[data_table_name] = rval.get(data_table_name, []) |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
120 rval[data_table_name].append(entry_dict) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
121 return rval |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
122 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
123 |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
124 def get_file_content(params, target_directory): |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
125 directory_content = params.get('directory_content', []) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
126 for content in directory_content: |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
127 target_path = os.path.join(target_directory, content.get('subdir', '')) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
128 try: |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
129 os.makedirs(target_path) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
130 except OSError: |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
131 pass |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
132 if content.get('file_source', {}).get('file_source_selector') == 'URL': |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
133 (filename, headers) = urlretrieve(content.get('file_source', {}).get('file_URL')) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
134 try: |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
135 bname = headers['Content-Disposition'] |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
136 except KeyError: |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
137 bname = os.path.basename(urlsplit(content.get('file_source', {}).get('file_URL')).path) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
138 else: |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
139 filename = content.get('file_source', {}).get('file_history') |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
140 bname = os.path.basename(filename) |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
141 file_action = content.get('file_action', {}).get('file_action_selector') |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
142 if file_action == 'unpack': |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
143 unpack_archive(filename, target_path) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
144 else: |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
145 filename_override = content.get('file_action', {}).get('filename_override') |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
146 if filename_override: |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
147 target_path = os.path.join(target_path, filename_override) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
148 else: |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
149 target_path = os.path.join(target_path, bname) |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
150 shutil.copyfile(filename, target_path) |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
151 return len(directory_content) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
152 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
153 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
154 def main(): |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
155 parser = optparse.OptionParser() |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
156 parser.add_option('', '--galaxy_data_manager_data_path', dest='galaxy_data_manager_data_path', default='', help='Root path for galaxy_data_manager_data_path') |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
157 (options, args) = parser.parse_args() |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
158 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
159 filename = args[0] |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
160 |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
161 with open(filename) as fh: |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
162 params = json.loads(fh.read()) |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
163 target_directory = params['output_data'][0]['extra_files_path'] |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
164 |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
165 data_table_entries = get_data_table_entries(params['param_dict'], options.galaxy_data_manager_data_path) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
166 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
167 # save info to json file |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
168 with open(filename, 'wb') as fh: |
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
169 fh.write(json.dumps({"data_tables": data_table_entries})) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
170 |
2
1c1e228884d3
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit f2ab0315fa6df9e3e917bbc112e29f384c3affba"
iuc
parents:
1
diff
changeset
|
171 get_file_content(params['param_dict'], target_directory) |
0
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
172 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
173 |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
174 if __name__ == "__main__": |
81ed42c0721a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_manual commit 9f2cdfc1302dce000f9a86d13d4af204cf1dc89d
iuc
parents:
diff
changeset
|
175 main() |