From 1f12b78ef3379ee407c76612a45695a20db846ae Mon Sep 17 00:00:00 2001 From: Marcus Stoegbauer Date: Mon, 1 Apr 2024 11:08:48 +0200 Subject: [PATCH] ignore .swp files when creating file_list, bumped version --- pyproject.toml | 2 +- userconfig/__init__.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index af9084b..f25f73e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "userconfig" -version = "2.0" +version = "2.0-1" authors = [ {name = "Marcus Stoegbauer", email = "marcus@grmpf.org"} ] maintainers = [ {name = "Marcus Stoegbauer", email = "marcus@grmpf.org"} ] description = "Generate config files for user home" diff --git a/userconfig/__init__.py b/userconfig/__init__.py index 8b86107..0804832 100644 --- a/userconfig/__init__.py +++ b/userconfig/__init__.py @@ -91,6 +91,9 @@ class Userconfig: (prio, category, value, category_dir) = category_dir_tuple self._cfg.debug.stdout(f'process category {category_dir}', 3) for file in os.scandir(category_dir): + if file.name.endswith('.swp'): + self._cfg.debug.stdout(f'Ignoring swap file {file.name}', 3) + continue if file.name not in file_list: file_list[file.name] = [] file_list[file.name].append(file.path)