aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjahoti <jahoti@tilde.team>2021-08-22 00:00:00 +0000
committerjahoti <jahoti@tilde.team>2021-08-22 00:00:00 +0000
commitbb550c369ab7239c2f8c630a2bc947cc8744a564 (patch)
tree3e7f7a7e98e56cce74e9186e5700fd71dda54f9b /test
parent9e280d4527e57cb4037fd81fb433c16f165de094 (diff)
downloadbrowser-extension-bb550c369ab7239c2f8c630a2bc947cc8744a564.tar.gz
browser-extension-bb550c369ab7239c2f8c630a2bc947cc8744a564.zip
Incorporate patch for test/gorilla.py
Patch by Wojtek provides a bundle-all option and only reads Hydrilla files.
Diffstat (limited to 'test')
-rwxr-xr-xtest/gorilla.py12
1 files changed, 11 insertions, 1 deletions
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]