From 1d1174425b2bed9586461cc7cc779cfed1cf1886 Mon Sep 17 00:00:00 2001 From: khuxkm fbexl Date: Wed, 23 Oct 2019 14:02:56 -0400 Subject: [PATCH] Don't load dotfiles, or files with an extension other than .json --- tracer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tracer.py b/tracer.py index 7f08f09..66d183b 100755 --- a/tracer.py +++ b/tracer.py @@ -40,7 +40,9 @@ def populate(): if os.path.isdir(d): for p in os.listdir(d): rule = d + "/" + p - name = p.replace(".json", "") + name, ext = os.path.splitext(p) + if p.startswith(".") or ext not in (".json", ""): # dot file or not .json or extensionless + continue # skip file # print(p, rule, name) if p in DB: DB[name].append(grammar(load_rules(rule)))