Skip to content

Commit a61b7f6

Browse files
committed
Undo optimizations to read_all_markdown
These will be submitted in a separate PR
1 parent ff5f567 commit a61b7f6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

bin/lesson_check.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,14 @@ def read_all_markdown(source_dir, parser):
255255
{path : {'metadata':yaml, 'metadata_len':N, 'text':text, 'lines':[(i, line, len)], 'doc':doc}}
256256
"""
257257

258+
all_dirs = [os.path.join(source_dir, d) for d in SOURCE_DIRS]
259+
all_patterns = [os.path.join(d, '*.md') for d in all_dirs]
258260
result = {}
259-
for d in SOURCE_DIRS:
260-
dpath = os.path.join(source_dir, d)
261-
262-
pattern = os.path.join(dpath, '*.md')
263-
for filename in glob.glob(pattern):
261+
for pat in all_patterns:
262+
for filename in glob.glob(pat):
264263
data = read_markdown(parser, filename)
265264
if data:
266265
result[filename] = data
267-
268266
return result
269267

270268

0 commit comments

Comments
 (0)