8000 Moves CommandLineBinding to separate file · illusional/python-cwlgen@b37994e · GitHub
[go: up one dir, main page]

Skip to content

Commit b37994e

Browse files
committed
Moves CommandLineBinding to separate file
1 parent 32a4abd commit b37994e

File tree

2 files changed

+41
-43
lines changed

2 files changed

+41
-43
lines changed

cwlgen/__init__.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -245,49 +245,6 @@ def get_dict(self):
245245
return dict_out
246246

247247

248-
class CommandLineBinding(object):
249-
'''
250-
Describes how the handle an input or an argument.
251-
'''
252-
253-
def __init__(self, load_contents=False, position=None, prefix=None, separate=True,
254-
item_separator=None, value_from=None, shell_quote=True):
255-
'''
256-
:param load_contents: Read up to the fist 64 KiB of text from the file and
257-
place it in the "contents" field of the file object
258-
:type load_contents: BOOLEAN
259-
:param position: The sorting key
260-
:type positio: INT
261-
:param prefix: Command line prefix to add before the value
262-
:type prefix: STRING
263-
:param separate:
264-
:type separate: BOOLEAN
265-
:param item_separator: Join the array elements into a single string separated by this item
266-
:type item_separator: STRING
267-
:param value_from: Use this as the value
268-
:type value_from: STRING
269-
:param shell_quote: Value is quoted on the command line
270-
:type shell_quote: BOOLEAN
271-
'''
272-
self.loadContents = load_contents
273-
self.position = position
274-
self.prefix = prefix
275-
self.separate = separate
276-
self.itemSeparator = item_separator
277-
self.valueFrom = value_from
278-
self.shellQuote = shell_quote
279-
280-
def get_dict(self):
281-
'''
282-
Transform the object to a [DICT] to write CWL.
283-
284-
:return: dictionnary of the object
285-
:rtype: DICT
286-
'''
287-
dict_binding = {k: v for k, v in vars(self).items() if v is not None}
288-
return dict_binding
289-
290-
291248
class CommandOutputBinding(object):
292249
'''
293250
Describes how to generate an output parameter based on the files produced.

cwlgen/commandlinebinding.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
class CommandLineBinding(object):
2+
'''
3+
Describes how the handle an input or an argument.
4+
'''
5+
6+
def __init__(self, load_contents=False, position=None, prefix=None, separate=True,
7+
item_separator=None, value_from=None, shell_quote=True):
8+
'''
9+
:param load_contents: Read up to the fist 64 KiB of text from the file and
10+
place it in the "contents" field of the file object
11+
:type load_contents: BOOLEAN
12+
:param position: The sorting key
13+
:type positio: INT
14+
:param prefix: Command line prefix to add before the value
15+
:type prefix: STRING
16+
:param separate:
17+
:type separate: BOOLEAN
18+
:param item_separator: Join the array elements into a single string separated by this item
19+
:type item_separator: STRING
20+
:param value_from: Use this as the value
21+
:type value_from: STRING
22+
:param shell_quote: Value is quoted on the command line
23+
:type shell_quote: BOOLEAN
24+
'''
25+
self.loadContents = load_contents
26+
self.position = position
27+
self.prefix = prefix
28+
self.separate = separate
29+
self.itemSeparator = item_separator
30+
self.valueFrom = value_from
31+
self.shellQuote = shell_quote
32+
33+
def get_dict(self):
34+
'''
35+
Transform the object to a [DICT] to write CWL.
36+
37+
:return: dictionnary of the object
38+
:rtype: DICT
39+
'''
40+
dict_binding = {k: v for k, v in vars(self).items() if v is not None}
41+
return dict_binding

0 commit comments

Comments
 (0)
0