mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
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:
parent
39ab006c8f
commit
4861d5add8
6 changed files with 70 additions and 21 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue