aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
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]