From bb550c369ab7239c2f8c630a2bc947cc8744a564 Mon Sep 17 00:00:00 2001 From: jahoti Date: Sun, 22 Aug 2021 00:00:00 +0000 Subject: Incorporate patch for test/gorilla.py Patch by Wojtek provides a bundle-all option and only reads Hydrilla files. --- test/gorilla.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/gorilla.py b/test/gorilla.py index cd6cc94..5bf64f5 100755 --- a/test/gorilla.py +++ b/test/gorilla.py @@ -18,7 +18,12 @@ def load_db(path): DB['path'] = path for file in os.listdir(path): - with open(path + file + os.sep + 'index.json') as f: + subdir = path + file + + if (os.st.S_IFMT(os.stat(subdir).st_mode) & os.st.S_IFDIR) == 0: + continue + + with open(subdir + os.sep + 'index.json') as f: data = json.load(f) type_, data['file'] = data['type'], file @@ -34,6 +39,11 @@ def load_db(path): def mkhachette(patterns): + patterns = set(patterns) + if '*' in patterns: + patterns.remove('*') + patterns.update(DB['page'].keys()) + scripts, bags, pages, new_bags = {}, {}, {}, [] for pattern in patterns: pages[pattern] = data = DB['page'][pattern] -- cgit v1.2.3