Skip to content

Commit

Permalink
Allow using wildcards to filter docstatus class names
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
bojidar-bg committed Sep 28, 2017
1 parent 62cb43b commit 1f60d0c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions doc/tools/doc_status.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3

import fnmatch
import os
import sys
import re
Expand Down Expand Up @@ -353,8 +354,13 @@ def generate_for_class(c):
class_names.sort()

if len(input_class_list) < 1:
input_class_list = class_names
input_class_list = ['*']

filtered_classes = set()
for pattern in input_class_list:
filtered_classes |= set(fnmatch.filter(class_names, pattern))
filtered_classes = list(filtered_classes)
filtered_classes.sort()

################################################################################
# Make output table #
Expand All @@ -366,10 +372,7 @@ def generate_for_class(c):

total_status = ClassStatus('Total')

for cn in input_class_list:
if not cn in classes:
print('Cannot find class ' + cn + '!')
sys.exit(255)
for cn in filtered_classes:

c = classes[cn]
validate_tag(c, 'class')
Expand Down

0 comments on commit 1f60d0c

Please sign in to comment.