Code review comment for lp:~barry/lazr.config/bug-310619

Revision history for this message
Barry Warsaw (barry) wrote :

Never mind. I think the branch /is/ okay. I added another test case to prove
it to myself. See attached incremental.

=== modified file 'src/lazr/config/README.txt'
--- src/lazr/config/README.txt 2008-12-23 02:09:06 +0000
+++ src/lazr/config/README.txt 2008-12-23 14:30:37 +0000
@@ -791,6 +791,24 @@
     key4 : F&#028c;k yeah!
     key5 :

+push() can also be used to extend master sections.
+
+ >>> for section in master_conf.getByCategory('bar'):
+ ... print section.name, section.baz
+ bar.master 1
+
+ >>> master_conf.push('override', """
+ ... [bar.two]
+ ... baz: 2
+ ...
+ ... [bar.three]
+ ... baz:3
+ ... """)
+ >>> for section in master_conf.getByCategory('bar'):
+ ... print section.name, section.baz
+ bar.two 2
+ bar.three 3
+

 pop()
 =====

=== modified file 'src/lazr/config/testdata/master.conf'
--- src/lazr/config/testdata/master.conf 2008-12-23 01:59:49 +0000
+++ src/lazr/config/testdata/master.conf 2008-12-23 14:30:02 +0000
@@ -1,3 +1,6 @@
 # This section defines a category master.
 [thing.master]
 foo: 0
+
+[bar.master]
+baz: 1

« Back to merge proposal