1 # SPDX-License-Identifier: MIT
3 # Copyright The SCons Foundation
5 DefaultEnvironment(tools=[])
8 'This line has no substitutions',
9 'This line has @subst@ substitutions',
10 'This line has %subst% substitutions',
13 sub1 = {'@subst@': 'most'}
14 sub2 = {'%subst%': 'many'}
15 sub3 = {'@subst@': 'most', '%subst%': 'many'}
17 env = Environment(tools=['textfile'])
19 t = env.Textfile('text', textlist)
21 s = env.Substfile('sub1', t)
23 s = env.Substfile('sub2', s, SUBST_DICT=sub1)
24 # the other substution
25 s = env.Substfile('sub3', s, SUBST_DICT=sub2)
26 # the reverse direction
27 s = env.Substfile('sub4', t, SUBST_DICT=sub2)
28 s = env.Substfile('sub5', s, SUBST_DICT=sub1)
30 s = env.Substfile('sub6', t, SUBST_DICT=sub3)