confini

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

commit 6c74b0feaaf9e7348b3896324c249206a8a13a3b
parent d1ba5268b54e180ef0bc88c1f85f095f749ab72b
Author: nolash <dev@holbrook.no>
Date:   Sun,  4 Oct 2020 13:06:48 +0200

Add boolean lookup

Diffstat:
MCHANGELOG | 4+++-
Mconfini/config.py | 8++++++++
Msetup.py | 2+-
3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -1,2 +1,4 @@ -1.0.0 +0.1.1 + - Add boolean lookup +0.1.0 - Add gnupg support diff --git a/confini/config.py b/confini/config.py @@ -126,6 +126,14 @@ class Config: return self._decrypt(k, v) + def true(self, k): + v = self.store.get(k) + d = self._decrypt(k, v) + if d.lower() not in ['true', 'false', '0', '1', 'on', 'off']: + raise ValueError('{} not a boolean value'.format(k)) + return d.lower() in ['true', '1', 'on'] + + def __str__(self): ls = [] for k in self.store.keys(): diff --git a/setup.py b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='confini', - version='0.1.0', + version='0.1.1', description='Parse, verify and merge all ini files in a single directory', author='Louis Holbrook', author_email='dev@holbrook.no',