confini

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

commit 74ef43d5e492aa64a223b7ca25448c50ad7228e2
parent 7db106beb3143bcfb50e021e938ed3cab7ea011a
Author: lash <dev@holbrook.no>
Date:   Thu, 20 Jan 2022 22:19:18 +0000

Remove temporary directory that triggers warnings

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

diff --git a/CHANGELOG b/CHANGELOG @@ -1,3 +1,7 @@ +0.5.4 + - Clean up temporary directories +0.5.3 + - Add section exclusion from export 0.5.0 - License change from GPL to WTFPL - Add remove method diff --git a/confini/config.py b/confini/config.py @@ -57,6 +57,12 @@ class Config: self.env_prefix = '{}_'.format(env_prefix) + def __clean(self): + if self.__target_tmpdir != None: + logg.debug('cleaning collection tmpdir {}'.format(self.__target_tmpdir.name)) + self.__target_tmpdir.cleanup() + + def collect_from_dirs(self, dirs): self.__target_tmpdir = tempfile.TemporaryDirectory() self.dirs = [self.__target_tmpdir.name] @@ -192,7 +198,7 @@ class Config: self.__process_doc_(d) - + def __process_schema_dir(self, in_dir): d = os.listdir(in_dir) d.sort() @@ -246,6 +252,8 @@ class Config: if set_as_current: set_current(self, description=self.dir) + self.__clean() + def _decrypt(self, k, v, src_dir): if len(self.decrypt) == 0: diff --git a/setup.py b/setup.py @@ -6,7 +6,7 @@ f.close() setup( name='confini', - version='0.5.3', + version='0.5.4', description='Parse, verify and merge all ini files in a single directory', author='Louis Holbrook', author_email='dev@holbrook.no',