3 log.getLogger().setLevel(log.DEBUG)
8 return conf.ConfigExpression([s], s)
10 root = conf.ConfigTree(None, None)
11 t_a = conf.ConfigTree('a', root)
12 t_a_b = conf.ConfigTree('b', t_a)
13 t_c = conf.ConfigTree('c', root)
15 v_r = conf.ConfigVar('r', root)
16 v_r.add_operation('SET', [], cs('ROOTVAR'))
21 v_a.append(conf.ConfigVar('va%d'%i, t_a))
22 v_a[i].add_operation('SET', [], cs('VALUE-A%d'%i))
24 v_b.append(conf.ConfigVar('vb%d'%i, t_a_b))
25 v_b[i].add_operation('APPEND', [], cs(' FOO'))
26 v_b[i].add_operation('SET', [], conf.ConfigExpression([v_a[i]], '{va%d}'%i))
27 v_b[i].add_operation('APPEND', [], cs(' BAR'))
29 v_b[i].add_operation('APPEND', [], conf.ConfigExpression([' ', v_b[i-1]], ' {vb%d}'%(i-1)))
30 print '\n'.join(root.pprint())
32 v_b[0].remove_operation(1)
33 v_b[0].add_operation('SET', [], cs('NEW-VALUE'))
34 v_b[1].add_operation('APPEND', [], cs(' NEW-ADDED'))
35 v_a[1].add_operation('APPEND', [], cs(' NEW-ADDED-A'))
36 print '\n'.join(root.pprint())
38 v_a[0].add_operation('SET', [], cs('NEW-VALUE-A0'))
39 print '\n'.join(root.pprint())