File tree 4 files changed +41
-32
lines changed
4 files changed +41
-32
lines changed Original file line number Diff line number Diff line change @@ -43,19 +43,7 @@ fn main() {
43
43
. env ( "PYTHONPATH" , & mako)
44
44
. env ( "TEMPLATE" , & template)
45
45
. env ( "PRODUCT" , product)
46
- . arg ( "-c" )
47
- . arg ( r#"
48
- import os
49
- import sys
50
- from mako.template import Template
51
- from mako import exceptions
52
- try:
53
- template = Template(open(os.environ['TEMPLATE'], 'rb').read(), input_encoding='utf8')
54
- print(template.render(PRODUCT=os.environ['PRODUCT']).encode('utf8'))
55
- except:
56
- sys.stderr.write(exceptions.text_error_template().render().encode('utf8'))
57
- sys.exit(1)
58
- "# )
46
+ . arg ( "generate_properties_rs.py" )
59
47
. stderr ( Stdio :: inherit ( ) )
60
48
. output ( )
61
49
. unwrap ( ) ;
Original file line number Diff line number Diff line change
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
+
5
+ import os
6
+ import sys
7
+
8
+ from mako import exceptions
9
+ from mako .template import Template
10
+
11
+ try :
12
+ template = Template (open (os .environ ['TEMPLATE' ], 'rb' ).read (),
13
+ input_encoding = 'utf8' )
14
+ print (template .render (PRODUCT = os .environ ['PRODUCT' ]).encode ('utf8' ))
15
+ except :
16
+ sys .stderr .write (exceptions .text_error_template ().render ().encode ('utf8' ))
17
+ sys .exit (1 )
Original file line number Diff line number Diff line change @@ -50,25 +50,7 @@ fn main() {
50
50
. env ( "PYTHONPATH" , & mako)
51
51
. env ( "STYLE_TEMPLATE" , & style_template)
52
52
. env ( "GECKOLIB_TEMPLATE" , & geckolib_template)
53
- . arg ( "-c" )
54
- . arg ( r#"
55
- import json
56
- import os
57
- import sys
58
- from mako.template import Template
59
- from mako import exceptions
60
- try:
61
- style_template = Template(filename=os.environ['STYLE_TEMPLATE'], input_encoding='utf8')
62
- style_template.render(PRODUCT='gecko')
63
-
64
- geckolib_template = Template(filename=os.environ['GECKOLIB_TEMPLATE'], input_encoding='utf8')
65
- output = geckolib_template.render(STYLE_STRUCTS = style_template.module.STYLE_STRUCTS,
66
- to_rust_ident = style_template.module.to_rust_ident)
67
- print(output.encode('utf8'))
68
- except:
69
- sys.stderr.write(exceptions.text_error_template().render().encode('utf8'))
70
- sys.exit(1)
71
- "# )
53
+ . arg ( "ports/geckolib/generate_properties_rs.py" )
72
54
. stderr ( Stdio :: inherit ( ) )
73
55
. output ( )
74
56
. unwrap ( ) ;
Original file line number Diff line number Diff line change
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
+
5
+ import os
6
+ import sys
7
+
8
+ from mako import exceptions
9
+ from mako .template import Template
10
+
11
+ try :
12
+ style_template = Template (filename = os .environ ['STYLE_TEMPLATE' ],
13
+ input_encoding = 'utf8' )
14
+ style_template .render (PRODUCT = 'gecko' )
15
+
16
+ geckolib_template = Template (filename = os .environ ['GECKOLIB_TEMPLATE' ], input_encoding = 'utf8' )
17
+ output = geckolib_template .render (STYLE_STRUCTS = style_template .module .STYLE_STRUCTS ,
18
+ to_rust_ident = style_template .module .to_rust_ident )
19
+ print (output .encode ('utf8' ))
20
+ except :
21
+ sys .stderr .write (exceptions .text_error_template ().render ().encode ('utf8' ))
22
+ sys .exit (1 )
You can’t perform that action at this time.
0 commit comments