Skip to content

Commit 421fc51

Browse files
add macros
1 parent 8f1b1a6 commit 421fc51

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

galaxyxml/tool/parameters/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,27 @@ def command_line(self):
4848
return None
4949

5050

51+
class Macros(XMLParam):
52+
name = "macros"
53+
54+
def acceptable_child(self, child):
55+
return isinstance(child, Macro)
56+
57+
58+
class Macro(XMLParam):
59+
name = "xml"
60+
61+
def __init__(self, name):
62+
params = Util.clean_kwargs(locals().copy())
63+
passed_kwargs = {}
64+
passed_kwargs['name'] = params['name']
65+
super(Expand, self).__init__(**passed_kwargs)
66+
67+
def acceptable_child(self, child):
68+
return issubclass(type(child), XMLParam) \
69+
and not isinstance(child, Macro)
70+
71+
5172
class Expand(XMLParam):
5273
"""
5374
<expand macro="...">

0 commit comments

Comments
 (0)