-
-
Save ben-hearn-sb/a626215d95f1b292e66b388be3c1eb2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def recurse_map_file_paths(input_dirs=None): | |
""" Recursively maps an input directory """ | |
if not type(input_dirs) is list: | |
input_dirs = [input_dirs] | |
file_paths = list() | |
for d in input_dirs: | |
for root, folder, filenames in os.walk(d): | |
for f in filenames: | |
if f.lower().endswith(cfg.file_types): | |
fpath = os.path.join(root, f).replace('\\', '/').strip() | |
fpath = normalize_filepath(fpath) | |
if not fpath in file_paths: | |
file_paths.append(fpath) | |
return file_paths |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment