Use ifind rather than glob to work around Windows path separator nonsense

This commit is contained in:
Tom Payne
2013-02-12 15:31:30 +01:00
parent a3e7528841
commit 169555f2be
+8 -3
View File
@@ -1,10 +1,10 @@
#!/usr/bin/env python #!/usr/bin/env python
from cStringIO import StringIO from cStringIO import StringIO
import glob
import gzip import gzip
import json import json
import os import os
import os.path
import re import re
import shutil import shutil
import sys import sys
@@ -42,9 +42,14 @@ EXTERNAL_SRC = [
'build/src/external/src/types.js'] 'build/src/external/src/types.js']
EXAMPLES = [path EXAMPLES = [path
for path in glob.glob('examples/*.html') for path in ifind('examples')
if not path.startswith('examples/standalone/')
if path.endswith('.html')
if path != 'examples/example-list.html'] if path != 'examples/example-list.html']
EXAMPLES_JSON = [example.replace('.html', '.json')
for example in EXAMPLES]
EXAMPLES_SRC = [path EXAMPLES_SRC = [path
for path in ifind('examples') for path in ifind('examples')
if path.endswith('.js') if path.endswith('.js')
@@ -195,7 +200,7 @@ def examples_star_combined_js(name, match):
@target('serve', PLOVR_JAR, INTERNAL_SRC, 'test/requireall.js', 'examples') @target('serve', PLOVR_JAR, INTERNAL_SRC, 'test/requireall.js', 'examples')
def serve(t): def serve(t):
t.run('%(JAVA)s', '-jar', PLOVR_JAR, 'serve', glob.glob('build/*.json'), glob.glob('examples/*.json'), glob.glob('test/*.json')) t.run('%(JAVA)s', '-jar', PLOVR_JAR, 'serve', 'build/ol.json', 'build/ol-all.json', EXAMPLES_JSON, 'test/test.json')
@target('serve-precommit', PLOVR_JAR, INTERNAL_SRC) @target('serve-precommit', PLOVR_JAR, INTERNAL_SRC)