confini

Parse and merge multiple ini files in python3
git clone git://git.defalsify.org/python-confini.git
Log | Files | Refs | README | LICENSE

commit e4685076d0af68a80075f5c46bc11c33c0e31826
parent 9638ea60a8d00f373ea9a6686dd3542e0716c049
Author: nolash <dev@holbrook.no>
Date:   Fri, 19 Feb 2021 21:38:29 +0100

Add all method

Diffstat:
Mconfini/config.py | 5+++++
Msetup.py | 2+-
Mtest/test_basic.py | 5+++++
3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/confini/config.py b/confini/config.py @@ -171,6 +171,10 @@ class Config: return self._decrypt(k, v) + def all(self): + return self.store + + def true(self, k): v = self.store.get(k) if type(v).__name__ == 'bool': @@ -202,6 +206,7 @@ class Config: + def config_from_environment(): config_dir = config_dir_from_environment() c = Config(config_dir) diff --git a/setup.py b/setup.py @@ -6,7 +6,7 @@ f.close() setup( name='confini', - version='0.3.6rc1', + version='0.3.6rc2', description='Parse, verify and merge all ini files in a single directory', author='Louis Holbrook', author_email='dev@holbrook.no', diff --git a/test/test_basic.py b/test/test_basic.py @@ -70,6 +70,11 @@ class TestBasic(unittest.TestCase): logg.debug(c) + def test_all(self): + inidir = os.path.join(self.wd, 'files') + c = Config(inidir) + a = c.all() + self.assertEqual(a, c.store) if __name__ == '__main__':