Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. def find_files(root, ignore_patterns, verbosity, symlinks=False):
  2.     """
  3.    Helper function to get all files in the given root.
  4.    """
  5.     all_files = []
  6.     for (dirpath, dirnames, filenames) in walk(".", followlinks=symlinks):
  7.         for f in filenames:
  8.             norm_filepath = os.path.normpath(os.path.join(dirpath, f))
  9.             if is_ignored(norm_filepath, ignore_patterns):
  10.                 if verbosity > 1:
  11.                     sys.stdout.write('ignoring file %s in %s\n' % (f, dirpath))
  12.             else:
  13.                 all_files.extend([(dirpath, f)])
  14.     all_files.sort()
  15.     return all_files
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement