OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 import glob | 3 import glob |
4 import os | 4 import os |
5 import os.path | 5 import os.path |
6 import subprocess | 6 import subprocess |
7 | 7 |
8 def HtmlConvert(infile): | 8 def HtmlConvert(infile): |
9 (head, tail) = os.path.split(infile) | 9 (head, tail) = os.path.split(infile) |
10 htmlconverter = os.path.join('..', '..', '..', 'client', | 10 htmlconverter = os.path.join('..', '..', '..', 'client', |
11 'tools', 'htmlconverter.py') | 11 'tools', 'htmlconverter.py') |
12 if head == 'tests': | 12 if head == 'tests': |
13 htmlconverter = os.path.join('..', htmlconverter) | 13 htmlconverter = os.path.join('..', htmlconverter) |
14 outdir = 'frog' | 14 outdir = 'frog' |
15 os.chdir('tests') | 15 os.chdir('tests') |
16 elif head == '': | 16 elif head == '': |
17 outdir = '.' | 17 outdir = '.' |
18 else: | 18 else: |
19 raise 'Illegal input: ' + infile | 19 raise 'Illegal input: ' + infile |
20 | 20 |
21 cmd = ['python', htmlconverter, tail, '-o', outdir, '--frog'] | 21 cmd = ['python', htmlconverter, tail, '-o', outdir] |
22 print 'Executing: ' + ' '.join(cmd) | 22 print 'Executing: ' + ' '.join(cmd) |
23 subprocess.call(cmd) | 23 subprocess.call(cmd) |
24 if head == 'tests': | 24 if head == 'tests': |
25 os.chdir('..') | 25 os.chdir('..') |
26 | 26 |
27 # Frog compile individual dom and html tests into tests/frog. | 27 # Frog compile individual dom and html tests into tests/frog. |
28 tests = glob.glob('tests/dom-*-*.html') | 28 tests = glob.glob('tests/dom-*-*.html') |
29 | 29 |
30 for test in tests: | 30 for test in tests: |
31 HtmlConvert(test) | 31 HtmlConvert(test) |
32 | 32 |
33 # Frog compile driver to index-js.html. | 33 # Frog compile driver to index-js.html. |
34 HtmlConvert('index.html') | 34 HtmlConvert('index.html') |
OLD | NEW |