From 18cabac9e1443373f81dcd2fcf3c860d8a9acc67 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sun, 29 Sep 2019 08:38:21 +0200 Subject: util: Ignore dotfiles in yaml loader --- lulua/util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lulua/util.py b/lulua/util.py index 1e2156d..f4ad76c 100644 --- a/lulua/util.py +++ b/lulua/util.py @@ -60,11 +60,13 @@ class YamlLoader: except yaml.reader.ReaderError: pass - raise KeyError + raise KeyError (k) def __iter__ (self): for res in pkg_resources.resource_listdir (__package__, self.defaultDir): - yield self.__getitem__ (res, onlyRes=True) + # ignore dotfiles, only include yaml + if not res.startswith ('.') and res.endswith ('.yaml'): + yield self.__getitem__ (res, onlyRes=True) def displayText (text): """ Convert text into a string that is always renderable without combining, -- cgit v1.2.3