# HG changeset patch # User Pierre-Yves David # Date 2017-06-17 16:41:55 # Node ID 0d757af1ea67894cc84d5b3cd36f9fd2c710180c # Parent 573baab2a7972a4ff8afa28d7792056727965c56 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... diff --git a/mercurial/configitems.py b/mercurial/configitems.py new file mode 100644 --- /dev/null +++ b/mercurial/configitems.py @@ -0,0 +1,21 @@ +# configitems.py - centralized declaration of configuration option +# +# Copyright 2017 Pierre-Yves David +# +# 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