diff --git a/Makefile b/Makefile index 6c0c1d75fe..f1093e717a 100644 --- a/Makefile +++ b/Makefile @@ -323,5 +323,5 @@ build/test_rendering_requires.js: $(SPEC_RENDERING_JS) @mkdir -p $(@D) @node tasks/generate-requires.js $^ > $@ -%shader.js: %.glsl src/ol/webgl/shader.mustache bin/pyglslunit.py - @python bin/pyglslunit.py --input $< --template src/ol/webgl/shader.mustache --output $@ +%shader.js: %.glsl src/ol/webgl/shader.mustache bin/pyglslunit.py build/timestamps/node-modules-timestamp + @python bin/pyglslunit.py --input $< | ./node_modules/.bin/mustache - src/ol/webgl/shader.mustache > $@ diff --git a/bin/pyglslunit.py b/bin/pyglslunit.py index 2bea402e52..de1b887bba 100644 --- a/bin/pyglslunit.py +++ b/bin/pyglslunit.py @@ -1,10 +1,10 @@ #!/usr/bin/python from optparse import OptionParser +import json import re import sys -import pystache ESCAPE_SEQUENCE = { @@ -42,7 +42,6 @@ def main(argv): option_parser = OptionParser() option_parser.add_option('--input') option_parser.add_option('--output') - option_parser.add_option('--template') options, args = option_parser.parse_args(argv[1:]) context = {} @@ -114,7 +113,7 @@ def main(argv): output = open(options.output, 'wb') else: output = sys.stdout - output.write(pystache.render(open(options.template, 'rb').read(), context)) + json.dump(context, output) if __name__ == '__main__': diff --git a/package.json b/package.json index c9411ba51e..9e01901660 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "jshint": "2.5.6", "mocha": "1.21.5", "mocha-phantomjs": "3.5.1", + "mustache": "2.1.3", "phantomjs": "1.9.10", "proj4": "2.3.6", "resemblejs": "1.2.0", diff --git a/requirements.txt b/requirements.txt index 6c244f7174..51ef3c38d5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz -pystache