annotate tests/run-tests.py @ 21:1fc7bef38c5f draft default tip

"planemo upload for repository https://github.com/galaxyproject/dunovo commit ac9577f0047ad984b307fe2c4b40e2eb45a0e6e2-dirty"
author nick
date Fri, 03 Apr 2020 19:47:34 +0000
parents 44c3abd1b767
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
1 #!/usr/bin/env python3
10
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
2 import os
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
3 import sys
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
4 import subprocess
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
5
17
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
6 SCRIPT_NAME = 'allele-counts.py'
10
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
7 DATASETS = [
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
8 'artificial',
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
9 'artificial-samples',
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
10 'artificial-nofilt',
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
11 'real',
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
12 'real-mit',
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
13 'real-mit-s',
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
14 'real-nofilt',
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
15 ]
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
16 IN_EXT = '.vcf.in'
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
17 OUT_EXT = '.csv.out'
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
18 ARGS_KEY = '##comment="ARGS='
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
19
17
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
20 XML = {
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
21 'tests_start':' <tests>',
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
22 'test_start': ' <test>',
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
23 'input': ' <param name="input" value="tests/%s" />',
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
24 'param': ' <param name="%s" value="%s" />',
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
25 'output': ' <output name="output" file="tests/%s" />',
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
26 'test_end': ' </test>',
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
27 'tests_end': ' </tests>',
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
28 }
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
29 PARAMS = {
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
30 '-f':'freq',
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
31 '-c':'covg',
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
32 '-H':'header',
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
33 '-s':'stranded',
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
34 '-n':'nofilt',
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
35 '-r':'seed',
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
36 }
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
37 PARAM_ARG = {
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
38 '-f':True,
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
39 '-c':True,
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
40 '-H':False,
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
41 '-s':False,
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
42 '-n':False,
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
43 '-r':True,
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
44 }
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
45
10
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
46 def main():
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
47
17
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
48 do_print_xml = False
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
49 if len(sys.argv) > 1:
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
50 if sys.argv[1] == '-x':
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
51 do_print_xml = True
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
52 else:
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
53 sys.stderr.write("Error: unrecognized option '"+sys.argv[1]+"'\n")
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
54 sys.exit(1)
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
55
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
56 test_dir = os.path.dirname(os.path.realpath(__file__))
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
57 script_dir = os.path.relpath(os.path.dirname(test_dir))
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
58 test_dir = os.path.relpath(test_dir)
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
59
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
60 if do_print_xml:
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
61 print(XML.get('tests_start'))
10
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
62
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
63 for dataset in DATASETS:
17
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
64 infile = os.path.join(test_dir, dataset+IN_EXT)
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
65 outfile = os.path.join(test_dir, dataset+OUT_EXT)
10
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
66
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
67 if not os.path.exists(infile):
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
68 sys.stderr.write("Error: file not found: "+infile+"\n")
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
69 continue
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
70 if not os.path.exists(outfile):
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
71 sys.stderr.write("Error: file not found: "+outfile+"\n")
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
72 continue
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
73
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
74 options = read_options(infile)
17
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
75 if do_print_xml:
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
76 print_xml(infile, outfile, options, XML, PARAMS, PARAM_ARG)
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
77 else:
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
78 run_tests(infile, outfile, options, script_dir)
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
79
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
80 if do_print_xml:
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
81 print(XML.get('tests_end'))
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
82
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
83
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
84 def run_tests(infile, outfile, options, script_dir):
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
85 script_cmd = os.path.join(script_dir, SCRIPT_NAME)+' '+options+' -i '+infile
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
86 bash_cmd = 'diff '+outfile+' <('+script_cmd+')'
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
87 print(script_cmd)
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
88 subprocess.call(['bash', '-c', bash_cmd])
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
89
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
90
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
91 def print_xml(infile, outfile, options_str, xml, params, param_arg):
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
92 infile = os.path.basename(infile)
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
93 outfile = os.path.basename(outfile)
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
94
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
95 options = options_str.split() # on whitespace
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
96
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
97 print(xml.get('test_start'))
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
98 print(xml.get('input') % infile)
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
99
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
100 # read in options one at a time, print <param> line
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
101 i = 0
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
102 while i < len(options):
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
103 opt = options[i]
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
104 if opt not in params or opt not in param_arg:
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
105 sys.stderr.write("Error: unknown option '"+opt+"' in ARGS list in file "+infile+"\n")
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
106 sys.exit(1)
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
107 # takes argument
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
108 if param_arg[opt]:
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
109 i+=1
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
110 arg = options[i]
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
111 print(xml.get('param') % (params[opt], arg))
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
112 # no argument (boolean)
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
113 else:
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
114 print(xml.get('param') % (params[opt], 'true'))
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
115 i+=1
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
116
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
117 print(xml.get('output') % outfile)
44c3abd1b767 "planemo upload for repository https://github.com/galaxyproject/dunovo commit 5a2e08bc1213b0437d0adcb45f7f431bd3c735f4"
nick
parents: 12
diff changeset
118 print(xml.get('test_end'))
10
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
119
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
120
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
121 def read_options(infile):
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
122 with open(infile, 'r') as infilehandle:
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
123 for line in infilehandle:
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
124 line.strip()
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
125 if ARGS_KEY == line[:len(ARGS_KEY)]:
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
126 return line[len(ARGS_KEY):-2]
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
127 return ''
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
128
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
129
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
130 if __name__ == '__main__':
db6f217dc45a Uploaded tarball.
nick
parents:
diff changeset
131 main()