mirror of
https://github.com/servo/servo.git
synced 2025-06-22 16:18:59 +01:00
This breaks out some of the parts on #10586, that should be easily mergeable. The idea would be to let you review & merge it first, and then I'll complete the other PR rebase off of this stuff.
17 lines
581 B
Python
17 lines
581 B
Python
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
import os
|
|
import sys
|
|
|
|
from mako import exceptions
|
|
from mako.template import Template
|
|
|
|
try:
|
|
template = Template(open(os.environ['TEMPLATE'], 'rb').read(),
|
|
input_encoding='utf8')
|
|
print(template.render(PRODUCT=os.environ['PRODUCT']).encode('utf8'))
|
|
except:
|
|
sys.stderr.write(exceptions.text_error_template().render().encode('utf8'))
|
|
sys.exit(1)
|