@@ -365,18 +365,18 @@ def ignore_nothing(_):
365365 return False
366366
367367
368- def walk (location , ignored = None , allow_symlinks = False ):
368+ def walk (location , ignored = None , follow_symlinks = False ):
369369 """
370370 Walk location returning the same tuples as os.walk but with a different
371371 behavior:
372372 - always walk top-down, breadth-first.
373- - always ignore and never follow symlinks (unless `allow_symlinks ` is True),
373+ - always ignore and never follow symlinks (unless `follow_symlinks ` is True),
374374 - always ignore special files (FIFOs, etc.)
375375 - optionally ignore files and directories by invoking the `ignored`
376376 callable on files and directories returning True if it should be ignored.
377377 - location is a directory or a file: for a file, the file is returned.
378378
379- If `allow_symlinks ` is True, then symlinks will not be ignored and be
379+ If `follow_symlinks ` is True, then symlinks will not be ignored and be
380380 collected like regular files and directories
381381 """
382382 if on_linux and py2 :
@@ -390,17 +390,17 @@ def walk(location, ignored=None, allow_symlinks=False):
390390 logger_debug ('walk: ignored:' , location , is_ignored )
391391 return
392392
393- if filetype .is_file (location , allow_symlinks = allow_symlinks ) :
393+ if filetype .is_file (location , follow_symlinks = follow_symlinks ) :
394394 yield parent_directory (location ), [], [file_name (location )]
395395
396- elif filetype .is_dir (location , allow_symlinks = allow_symlinks ):
396+ elif filetype .is_dir (location , follow_symlinks = follow_symlinks ):
397397 dirs = []
398398 files = []
399399 # TODO: consider using scandir
400400 for name in os .listdir (location ):
401401 loc = os .path .join (location , name )
402402 if filetype .is_special (loc ) or (ignored and ignored (loc )):
403- if (allow_symlinks
403+ if (follow_symlinks
404404 and filetype .is_link (loc )
405405 and not filetype .is_broken_link (location )):
406406 pass
@@ -410,18 +410,18 @@ def walk(location, ignored=None, allow_symlinks=False):
410410 logger_debug ('walk: ignored:' , loc , ign )
411411 continue
412412 # special files and symlinks are always ignored
413- if filetype .is_dir (loc , allow_symlinks = allow_symlinks ):
413+ if filetype .is_dir (loc , follow_symlinks = follow_symlinks ):
414414 dirs .append (name )
415- elif filetype .is_file (loc , allow_symlinks = allow_symlinks ):
415+ elif filetype .is_file (loc , follow_symlinks = follow_symlinks ):
416416 files .append (name )
417417 yield location , dirs , files
418418
419419 for dr in dirs :
420- for tripple in walk (os .path .join (location , dr ), ignored , allow_symlinks = allow_symlinks ):
420+ for tripple in walk (os .path .join (location , dr ), ignored , follow_symlinks = follow_symlinks ):
421421 yield tripple
422422
423423
424- def resource_iter (location , ignored = ignore_nothing , with_dirs = True , allow_symlinks = False ):
424+ def resource_iter (location , ignored = ignore_nothing , with_dirs = True , follow_symlinks = False ):
425425 """
426426 Return an iterable of paths at `location` recursively.
427427
@@ -432,7 +432,7 @@ def resource_iter(location, ignored=ignore_nothing, with_dirs=True, allow_symlin
432432 """
433433 if on_linux and py2 :
434434 location = fsencode (location )
435- for top , dirs , files in walk (location , ignored , allow_symlinks = allow_symlinks ):
435+ for top , dirs , files in walk (location , ignored , follow_symlinks = follow_symlinks ):
436436 if with_dirs :
437437 for d in dirs :
438438 yield os .path .join (top , d )
0 commit comments