~barry/lazr.config/megamerge

« back to all changes in this revision

Viewing changes to src/lazr/config/README.txt

  • Committer: Barry Warsaw
  • Date: 2008-12-31 03:30:43 UTC
  • Revision ID: barry@python.org-20081231033043-2uqzueowc8gzwr5r
Another refinement to push() and .masters.  We can't filter out the master
sections early on since that breaks stacked pushes.  Filter them out in the
iteration over the sections.

Show diffs side-by-side

added added

removed removed

Lines of Context:
839
839
    ...                   key=attrgetter('name'))
840
840
    >>> for section in sections:
841
841
    ...     print section.name, section.baz
842
 
    bar.master badger
843
842
    bar.soup cougar
844
843
 
845
844
    >>> master_conf.push('override', """
865
864
    bar.three emu
866
865
    bar.two dolphin
867
866
 
 
867
push() works with master sections too.
 
868
 
 
869
    >>> schema_file = StringIO.StringIO("""\
 
870
    ... [thing.template]
 
871
    ... foo: 0
 
872
    ... bar: 0
 
873
    ... [thing.one]
 
874
    ... """)
 
875
    >>> push_schema = ConfigSchema('schema.cfg', schema_file)
 
876
 
 
877
    >>> config_file = StringIO.StringIO("""\
 
878
    ... [thing.one]
 
879
    ... foo: 1
 
880
    ... """)
 
881
    >>> push_config = push_schema.loadFile(config_file, 'config.cfg')
 
882
    >>> print push_config.thing.one.foo
 
883
    1
 
884
    >>> print push_config.thing.one.bar
 
885
    0
 
886
 
 
887
    >>> push_config.push('test.cfg', """\
 
888
    ... [thing.one]
 
889
    ... bar: 2
 
890
    ... """)
 
891
    >>> print push_config.thing.one.foo
 
892
    1
 
893
    >>> print push_config.thing.one.bar
 
894
    2
 
895
 
868
896
 
869
897
pop()
870
898
=====