configitems: add a basic class to hold config item information
The goal of this class is allow explicit declaration for the available config
option. This class will hold the data for one specific config item.
To keep it simple we start centralizing the handling of the default config value.
In the future we can expect more data to be carried on this class. For example:
- documentation,
- status (experimental, advanced, normal, deprecated),
- aliases,
- expected type,
- etc...
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/configitems.py Sat Jun 17 18:41:55 2017 +0200
@@ -0,0 +1,21 @@
+# configitems.py - centralized declaration of configuration option
+#
+# Copyright 2017 Pierre-Yves David <pierre-yves.david@octobus.net>
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+from __future__ import absolute_import
+
+class configitem(object):
+ """represent a known config item
+
+ :section: the official config section where to find this item,
+ :name: the official name within the section,
+ :default: default value for this item,
+ """
+
+ def __init__(self, section, name, default=None):
+ self.section = section
+ self.name = name
+ self.default = default