@@ -349,14 +349,12 @@ def create_from_files(cls, top_dir):
349
349
if top_dir .endswith (".py" ):
350
350
return
351
351
352
- for path , folders , filenames in os .walk (top_dir ):
353
- folders [:] = [d for d in folders if d not in FOLDERS_TO_IGNORE ]
354
- for filename in filenames :
355
- if filename .endswith (".txt" ) or filename .endswith (".rst" ):
356
- yield cls (
357
- top_dir ,
358
- os .path .join (path , filename ),
359
- )
352
+ for path , filename in cls .walk_and_filter_folder (top_dir ):
353
+ if filename .endswith (".txt" ) or filename .endswith (".rst" ):
354
+ yield cls (
355
+ top_dir ,
356
+ os .path .join (path , filename ),
357
+ )
360
358
361
359
def scan (self ):
362
360
with open (self .path ) as doc_file :
@@ -400,14 +398,12 @@ def create_from_files(cls, top_dir):
400
398
if top_dir .endswith (".py" ):
401
399
return
402
400
403
- for path , folders , filenames in os .walk (top_dir ):
404
- folders [:] = [d for d in folders if d not in FOLDERS_TO_IGNORE ]
405
- for filename in filenames :
406
- if fnmatch .fnmatch (filename , "*settings.py" ):
407
- yield cls (
408
- top_dir ,
409
- os .path .join (path , filename ),
410
- )
401
+ for path , filename in cls .walk_and_filter_folder (top_dir ):
402
+ if fnmatch .fnmatch (filename , "*settings.py" ):
403
+ yield cls (
404
+ top_dir ,
405
+ os .path .join (path , filename ),
406
+ )
411
407
412
408
def scan (self ):
413
409
for node in ast .walk (self ._get_tree ()):
0 commit comments