Add some machinery to allow us to disable CSS properties (or a subset of values for a property) on a per-product basis.

This commit is contained in:
Bobby Holley 2016-04-06 16:16:00 -07:00
parent 39ab006c8f
commit 4861d5add8
6 changed files with 70 additions and 21 deletions

View file

@ -38,9 +38,11 @@ fn main() {
let style = Path::new(file!()).parent().unwrap();
let mako = style.join("Mako-0.9.1.zip");
let template = style.join("properties.mako.rs");
let product = if cfg!(feature = "gecko") { "gecko" } else { "servo" };
let result = Command::new(python)
.env("PYTHONPATH", &mako)
.env("TEMPLATE", &template)
.env("PRODUCT", product)
.arg("-c")
.arg(r#"
import os
@ -48,7 +50,8 @@ import sys
from mako.template import Template
from mako import exceptions
try:
print(Template(filename=os.environ['TEMPLATE'], input_encoding='utf8').render().encode('utf8'))
print(Template(filename=os.environ['TEMPLATE'], input_encoding='utf8').render(PRODUCT=os.environ['PRODUCT'])
.encode('utf8'))
except:
sys.stderr.write(exceptions.text_error_template().render().encode('utf8'))
sys.exit(1)