commit e67501d22daddd9cd9ba11ec471ff408447d0e80
parent 5db75d07238f0f7129d73006db8fc52031f5ec33
Author: nolash <dev@holbrook.no>
Date: Wed, 26 Aug 2020 09:36:44 +0200
Skip files not matching *.ini$
Diffstat:
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/confini/config.py b/confini/config.py
@@ -5,6 +5,7 @@ import sys
import os
import tempfile
import configparser
+import re
logg = logging.getLogger()
@@ -77,8 +78,10 @@ class Config:
tmp = tempfile.NamedTemporaryFile(delete=False)
tmpname = tmp.name
for filename in os.listdir(self.dir):
- if not '.ini' in filename:
+ if re.match(r'.+\.ini$', filename) == None:
+ logg.debug('skipping file {}'.format(filename))
continue
+ logg.info('reading file {}'.format(filename))
f = open(os.path.join(self.dir, filename), 'rb')
while 1:
data = f.read()
diff --git a/setup.py b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup
setup(
name='confini',
- version='0.0.4',
+ version='0.0.5',
description='Parse, verify and merge all ini files in a single directory',
author='Louis Holbrook',
author_email='dev@holbrook.no',