-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
executable file
·59 lines (51 loc) · 1.44 KB
/
test.py
File metadata and controls
executable file
·59 lines (51 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python
import os
from piperunner import GEJob, GESeriesJob, GEParallelJob
def _main():
try:
os.mkdir("test")
except OSError as e:
if e.errno != 17:
raise e
grep_class = GEJob(
"/bin/grep",
args=["'class '", "piperunner.py"],
binary=True, cwd=True,
stdout="./test/grep_class.txt",
stderr="/dev/null"
)
cut_class = GEJob(
"/bin/cut",
args=["-d", "' '", "-f", '2', "./test/grep_class.txt"],
binary=True, cwd=True,
stdout="./test/cut_class.txt",
stderr="/dev/null"
)
get_class = GESeriesJob([grep_class, cut_class])
grep_def = GEJob(
"/bin/grep",
args=["'def '", "piperunner.py"],
binary=True, cwd=True,
stdout="./test/grep_def.txt",
stderr="/dev/null"
)
cut_def = GEJob(
"/bin/awk",
args=["'{print $2}'", "./test/grep_def.txt"],
binary=True, cwd=True,
stdout="./test/cut_def.txt",
stderr="/dev/null"
)
get_def = GESeriesJob([grep_def, cut_def])
get_attrs = GEParallelJob([get_class, get_def])
cat_attrs = GEJob(
"/bin/cat",
args=["./test/cut_class.txt", "./test/cut_def.txt"],
binary=True, cwd=True,
stdout="./test/cat_attrs.txt",
stderr="/dev/null"
)
pipeline = GESeriesJob([get_attrs, cat_attrs])
pipeline.submit()
if __name__ == "__main__":
_main()