Rev 5759: Config sections only implement read access. in file:///home/vila/src/bzr/experimental/config/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Mon May 2 09:23:14 UTC 2011
At file:///home/vila/src/bzr/experimental/config/
------------------------------------------------------------
revno: 5759
revision-id: v.ladeuil+lp at free.fr-20110502092314-kogvblopa3th0qfc
parent: v.ladeuil+lp at free.fr-20110502081559-nvitkeoe611i929q
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: config-section
timestamp: Mon 2011-05-02 11:23:14 +0200
message:
Config sections only implement read access.
-------------- next part --------------
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py 2011-05-02 08:15:59 +0000
+++ b/bzrlib/config.py 2011-05-02 09:23:14 +0000
@@ -2094,7 +2094,7 @@
self._transport.put_file(self._filename, out_file)
-class ReadOnlySection(object):
+class Section(object):
"""A section defines a dict of options.
This is merely a read-only dict which can add some knowledge about the
@@ -2115,7 +2115,7 @@
"""Was the option created during the MutableSection lifetime"""
-class MutableSection(ReadOnlySection):
+class MutableSection(Section):
"""A section allowing changes and keeping track of the original values."""
def __init__(self, section_id, options):
=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py 2011-05-02 08:15:59 +0000
+++ b/bzrlib/tests/test_config.py 2011-05-02 09:23:14 +0000
@@ -1821,18 +1821,18 @@
def test_get_a_value(self):
a_dict = dict(foo='bar')
- section = config.ReadOnlySection('myID', a_dict)
+ section = config.Section('myID', a_dict)
self.assertEquals('bar', section.get('foo'))
def test_get_unknown_option(self):
a_dict = dict()
- section = config.ReadOnlySection('myID', a_dict)
+ section = config.Section('myID', a_dict)
self.assertEquals('out of thin air',
section.get('foo', 'out of thin air'))
def test_options_is_shared(self):
a_dict = dict()
- section = config.ReadOnlySection('myID', a_dict)
+ section = config.Section('myID', a_dict)
self.assertIs(a_dict, section.options)
More information about the bazaar-commits
mailing list