mirror of
https://github.com/nikdoof/tvorganise.git
synced 2025-12-13 06:42:16 +00:00
Fix find_files to be able to handle str and list
This commit is contained in:
@@ -25,16 +25,20 @@ def same_partition(path1, path2):
|
||||
|
||||
def find_files(args):
|
||||
"""
|
||||
Takes a list of files/folders, grabs files inside them. Does not
|
||||
recurse more than one level (if a folder is supplied, it will list
|
||||
files within)
|
||||
Take a singular path or a list of paths and provides a list of all files in
|
||||
that directory structure.
|
||||
"""
|
||||
filelist = []
|
||||
|
||||
if isinstance(args, list):
|
||||
for path in args:
|
||||
for root, dirs, files in os.walk(path, topdown=False):
|
||||
for name in files:
|
||||
filelist.append(os.path.join(root, name))
|
||||
else:
|
||||
for root, dirs, files in os.walk(args, topdown=False):
|
||||
for name in files:
|
||||
filelist.append(os.path.join(root, name))
|
||||
|
||||
return filelist
|
||||
|
||||
|
||||
Reference in New Issue
Block a user