about summary refs log tree commit diff
path: root/tracer.py
diff options
context:
space:
mode:
authorkhuxkm fbexl <khuxkm@ttm.sh>2019-10-23 14:02:56 -0400
committerkhuxkm fbexl <khuxkm@ttm.sh>2019-10-23 14:15:12 -0400
commit1d1174425b2bed9586461cc7cc779cfed1cf1886 (patch)
tree4777e73ffe40b481f91eb9f43adf06e8d4f57576 /tracer.py
parentc991a9961b2106d312cc1231a869f7e00e65a322 (diff)
Don't load dotfiles, or files with an extension other than .json
Diffstat (limited to 'tracer.py')
-rwxr-xr-xtracer.py4
1 files changed, 3 insertions, 1 deletions
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)))