Rev 5760: Add an ad-hoc __repr__. in file:///home/vila/src/bzr/experimental/config/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue May 3 07:47:33 UTC 2011


At file:///home/vila/src/bzr/experimental/config/

------------------------------------------------------------
revno: 5760
revision-id: v.ladeuil+lp at free.fr-20110503074733-wr7auo03nzvmst7r
parent: v.ladeuil+lp at free.fr-20110502092314-kogvblopa3th0qfc
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: config-section
timestamp: Tue 2011-05-03 09:47:33 +0200
message:
  Add an ad-hoc __repr__.
-------------- next part --------------
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2011-05-02 09:23:14 +0000
+++ b/bzrlib/config.py	2011-05-03 07:47:33 +0000
@@ -2110,6 +2110,11 @@
     def get(self, name, default=None):
         return self.options.get(name, default)
 
+    def __repr__(self):
+        # Mostly for debugging use
+        return "<%s.%s id=%s>" % (self.__module__, self.__class__.__name__,
+                                  self.id)
+
 
 _NewlyCreatedOption = object()
 """Was the option created during the MutableSection lifetime"""

=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2011-05-02 09:23:14 +0000
+++ b/bzrlib/tests/test_config.py	2011-05-03 07:47:33 +0000
@@ -1814,7 +1814,7 @@
         self.assertIs(None, bzrdir_config.get_default_stack_on())
 
 
-class TestConfigReadOnlySection(tests.TestCase):
+class TestSection(tests.TestCase):
 
     # FIXME: Parametrize so that all sections produced by Stores run these
     # tests -- vila 2011-04-01
@@ -1836,7 +1836,7 @@
         self.assertIs(a_dict, section.options)
 
 
-class TestConfigMutableSection(tests.TestCase):
+class TestMutableSection(tests.TestCase):
 
     # FIXME: Parametrize so that all sections (including os.environ and the
     # ones produced by Stores) run these tests -- vila 2011-04-01



More information about the bazaar-commits mailing list