Rev 5771: Some doc for the stores. in file:///home/vila/src/bzr/experimental/config/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Apr 8 15:55:03 UTC 2011


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

------------------------------------------------------------
revno: 5771
revision-id: v.ladeuil+lp at free.fr-20110408155502-9ojf971rtcrwnr9s
parent: v.ladeuil+lp at free.fr-20110408153701-ya47hutq734zh4g8
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: config-abstract-store
timestamp: Fri 2011-04-08 17:55:02 +0200
message:
  Some doc for the stores.
-------------- next part --------------
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2011-04-08 15:37:01 +0000
+++ b/bzrlib/config.py	2011-04-08 15:55:02 +0000
@@ -2260,6 +2260,12 @@
         return MutableSection(section_name, section)
 
 
+# Note that LockableConfigObjStore inherits from ConfigObjStore because we need
+# unlockable stores for use with objects that can already ensure the locking
+# (think branches). If different stores (not based on ConfigObj) are created,
+# they may face the same issue.
+
+
 class LockableConfigObjStore(ConfigObjStore):
     """A ConfigObjStore using locks on save to ensure store integrity."""
 

=== modified file 'doc/developers/configuration.txt'
--- a/doc/developers/configuration.txt	2011-04-08 14:59:29 +0000
+++ b/doc/developers/configuration.txt	2011-04-08 15:55:02 +0000
@@ -21,3 +21,24 @@
 MutableSection are needed to set or remove an option, ReadOnlySection should
 be used otherwise.
 
+Stores
+------
+
+Options can persistent in which case they are saved into Stores.
+
+``config.Store`` defines the abstract interface that all stores should
+implement.
+
+This object doesn't provide a direct access to the options, it only provides
+access to Sections. This is deliberate to ensure that sections can be properly
+shared by reusing the same underlying objects. Accessing options should be
+done via the ``Section`` objects.
+
+A ``Store`` can contain one or more sections, each section is uniquely
+identified by a unicode string.
+
+``config.ConfigObjStore`` is an implementation that use ``ConfigObj``.
+
+Depending on the object it is associated with (or not) a ``Store`` also needs
+to implement a locking mechanism. ``LockableConfigObjStore`` implements such a
+mechanism for ``ConfigObj`` based stores.



More information about the bazaar-commits mailing list