Skip to content

Commit 99c8c38

Browse files
author
Peter Amstutz
committed
Initial commit.
0 parents  commit 99c8c38

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

README

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Wrap cwltool to perform multiple executions of a given workflow where input
2+
objects are provided on stdin and output objects are printed on stdout.

cwl_service.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env python
2+
3+
import sys
4+
import cwltool.main
5+
import tempfile
6+
import logging
7+
8+
_logger = logging.getLogger("cwltool")
9+
_logger.setLevel(logging.ERROR)
10+
11+
def main(args=None):
12+
if args is None:
13+
args = sys.argv[1:]
14+
15+
if len(args) == 0:
16+
print "Workflow must be on command line"
17+
return 1
18+
19+
a = True
20+
while a:
21+
a = True
22+
msg = ""
23+
while a and a != "\n":
24+
a = sys.stdin.readline()
25+
msg += a
26+
27+
t = tempfile.NamedTemporaryFile()
28+
t.write(msg)
29+
t.flush()
30+
if cwltool.main.main([args[0], t.name]) != 0:
31+
return 1
32+
sys.stdout.write("\n\n")
33+
34+
if __name__ == "__main__":
35+
sys.exit(main(sys.argv[1:]))

setup.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env python
2+
3+
import os
4+
import sys
5+
import setuptools.command.egg_info as egg_info_cmd
6+
import shutil
7+
8+
from setuptools import setup, find_packages
9+
10+
SETUP_DIR = os.path.dirname(__file__)
11+
README = os.path.join(SETUP_DIR, 'README')
12+
13+
setup(name='cwl_service',
14+
version='1.0',
15+
description='Common workflow language runner service',
16+
long_description=open(README).read(),
17+
author='Common workflow language working group',
18+
author_email='[email protected]',
19+
url="https://github.com/common-workflow-language/common-workflow-language",
20+
download_url="https://github.com/common-workflow-language/common-workflow-language",
21+
license='Apache 2.0',
22+
py_modules=["cwl_service"],
23+
install_requires=[
24+
'cwltool'
25+
],
26+
entry_points={
27+
'console_scripts': [ "cwl-service=cwl_service:main" ]
28+
},
29+
zip_safe=True
30+
)

0 commit comments

Comments
 (0)