diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2019-09-29 08:38:21 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2019-09-29 08:38:21 +0200 |
commit | 18cabac9e1443373f81dcd2fcf3c860d8a9acc67 (patch) | |
tree | d2ff1d6142da089449d8897bcdd8c0959ba0da6b /lulua | |
parent | 190937bd2f5660ae8db71456ddbf5de22e9bc608 (diff) | |
download | lulua-18cabac9e1443373f81dcd2fcf3c860d8a9acc67.tar.gz lulua-18cabac9e1443373f81dcd2fcf3c860d8a9acc67.tar.bz2 lulua-18cabac9e1443373f81dcd2fcf3c860d8a9acc67.zip |
util: Ignore dotfiles in yaml loader
Diffstat (limited to 'lulua')
-rw-r--r-- | lulua/util.py | 6 |
1 files 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, |