|
6 | 6 | import collections
|
7 | 7 | import os
|
8 | 8 | from distutils.dir_util import copy_tree
|
9 |
| -from enum import Enum |
| 9 | +from enum import auto, Enum |
10 | 10 |
|
11 | 11 | import yaml
|
12 | 12 | from galaxy.tool_util.cwl.parser import workflow_proxy
|
|
39 | 39 | "defintion must field [%s].")
|
40 | 40 |
|
41 | 41 |
|
42 |
| -RunnableType = Enum( |
43 |
| - "RunnableType", 'galaxy_tool galaxy_datamanager galaxy_workflow cwl_tool cwl_workflow directory' |
44 |
| -) |
45 |
| - |
46 |
| - |
47 |
| -@property |
48 |
| -def _runnable_type_has_tools(runnable_type): |
49 |
| - return runnable_type.name in ["galaxy_tool", "galaxy_datamanager", "cwl_tool", "directory"] |
50 |
| - |
51 |
| - |
52 |
| -@property |
53 |
| -def _runnable_type_is_single_artifact(runnable_type): |
54 |
| - return runnable_type.name not in ["directory"] |
| 42 | +class RunnableType(Enum): |
| 43 | + galaxy_tool = auto() |
| 44 | + galaxy_datamanager = auto() |
| 45 | + galaxy_workflow = auto() |
| 46 | + cwl_tool = auto() |
| 47 | + cwl_workflow = auto() |
| 48 | + directory = auto() |
55 | 49 |
|
| 50 | + @property |
| 51 | + def has_tools(runnable_type): |
| 52 | + return runnable_type.name in ["galaxy_tool", "galaxy_datamanager", "cwl_tool", "directory"] |
56 | 53 |
|
57 |
| -@property |
58 |
| -def _runnable_type_test_data_in_parent_dir(runnable_type): |
59 |
| - return runnable_type.name in ["galaxy_datamanager"] |
60 |
| - |
| 54 | + @property |
| 55 | + def is_single_artifact(runnable_type): |
| 56 | + return runnable_type.name not in ["directory"] |
61 | 57 |
|
62 |
| -@property |
63 |
| -def _runnable_type_is_galaxy_artifact(runnable_type): |
64 |
| - return "galaxy" in runnable_type.name |
| 58 | + @property |
| 59 | + def test_data_in_parent_dir(runnable_type): |
| 60 | + return runnable_type.name in ["galaxy_datamanager"] |
65 | 61 |
|
| 62 | + @property |
| 63 | + def is_galaxy_artifact(runnable_type): |
| 64 | + return "galaxy" in runnable_type.name |
66 | 65 |
|
67 |
| -RunnableType.has_tools = _runnable_type_has_tools |
68 |
| -RunnableType.is_single_artifact = _runnable_type_is_single_artifact |
69 |
| -RunnableType.test_data_in_parent_dir = _runnable_type_test_data_in_parent_dir |
70 |
| -RunnableType.is_galaxy_artifact = _runnable_type_is_galaxy_artifact |
71 | 66 |
|
72 | 67 | _Runnable = collections.namedtuple("Runnable", ["path", "type"])
|
73 | 68 |
|
|
0 commit comments