Mercurial > repos > tduigou > parameters_maystro_workflow_2
annotate maystro.py @ 0:f80ed73f9f9a draft default tip
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
| author | tduigou | 
|---|---|
| date | Wed, 23 Jul 2025 09:40:00 +0000 | 
| parents | |
| children | 
| rev | line source | 
|---|---|
| 0 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 1 import argparse | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 2 import tempfile | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 3 import os | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 4 import json | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 5 import shutil | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 6 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 7 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 8 def parse_command_line_args(): | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 9 parser = argparse.ArgumentParser(description="Maystro JSON Handler") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 10 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 11 parser.add_argument("--distribute_json", required=True, help="true or false") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 12 parser.add_argument("--json_from_workflow", required=False, nargs='+', help="JSON files from tools", default=[]) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 13 parser.add_argument("--json_from_user", required=False, help="User-provided JSON") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 14 parser.add_argument("--json_name_mapping", required=True, help="map the real json name") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 15 parser.add_argument("--output_workflow", required=True, help="JSON output for next workflow steps") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 16 parser.add_argument("--output_user", required=True, help="Final JSON output to user") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 17 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 18 return parser.parse_args() | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 19 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 20 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 21 def parse_file_name_mapping(mapping_str): | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 22 mapping = {} | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 23 if mapping_str: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 24 for pair in mapping_str.split(','): | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 25 stored, original = pair.strip().split(':', 1) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 26 # Strip .json from original | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 27 real_name = os.path.splitext(original)[0] | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 28 mapping[os.path.basename(stored)] = real_name | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 29 return mapping | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 30 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 31 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 32 def handle_distribute_json_false(args): | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 33 temp_dir = tempfile.mkdtemp(prefix="maystro_merge_") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 34 print(f"[INFO] Watching temp dir for new JSONs: {temp_dir}") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 35 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 36 try: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 37 # Collect JSONs from json_from_workflow | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 38 initial_jsons = list(filter(os.path.isfile, args.json_from_workflow)) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 39 print(f"[INFO] Initial JSONs from workflow: {initial_jsons}") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 40 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 41 # Parse filename mapping if provided | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 42 filename_mapping = parse_file_name_mapping(getattr(args, 'json_name_mapping', '')) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 43 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 44 # Merge all together | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 45 merged = {} | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 46 for file_path in initial_jsons: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 47 try: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 48 with open(file_path, 'r') as f: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 49 data = json.load(f) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 50 basename = os.path.basename(file_path) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 51 real_name = filename_mapping.get(basename, basename) # fallback if not in mapping | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 52 merged[real_name] = data | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 53 print(f"[INFO] Added data under key: {real_name}") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 54 except json.JSONDecodeError as e: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 55 print(f"[WARN] Skipping invalid JSON file {file_path}: {e}") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 56 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 57 with open(args.output_user, "w") as f: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 58 json.dump(merged, f, indent=2) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 59 print(f"[INFO] Merged JSON written to: {args.output_user}") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 60 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 61 finally: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 62 print(f"[INFO] Cleaning up: {temp_dir}") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 63 shutil.rmtree(temp_dir) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 64 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 65 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 66 def merge_json_files(paths): | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 67 merged = {} | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 68 for path in paths: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 69 try: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 70 with open(path, "r") as f: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 71 data = json.load(f) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 72 merged.update(data) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 73 except Exception as e: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 74 print(f"[WARN] Skipping {path}: {e}") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 75 return merged | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 76 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 77 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 78 def handle_distribute_json_true(args): | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 79 if not args.json_from_user: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 80 raise ValueError("json_from_user is required when distribute_json is true") | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 81 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 82 with open(args.json_from_user, 'r') as in_f: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 83 user_data = json.load(in_f) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 84 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 85 with open(args.output_workflow, 'w') as out_f: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 86 json.dump(user_data, out_f, indent=2) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 87 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 88 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 89 def main(): | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 90 args = parse_command_line_args() | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 91 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 92 if args.distribute_json.lower() == 'false': | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 93 handle_distribute_json_false(args) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 94 else: | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 95 handle_distribute_json_true(args) | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 96 | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 97 if __name__ == "__main__": | 
| 
f80ed73f9f9a
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools/parameters_maystro commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
 tduigou parents: diff
changeset | 98 main() | 
