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,14 +25,18 @@ def same_partition(path1, path2):
|
|||||||
|
|
||||||
def find_files(args):
|
def find_files(args):
|
||||||
"""
|
"""
|
||||||
Takes a list of files/folders, grabs files inside them. Does not
|
Take a singular path or a list of paths and provides a list of all files in
|
||||||
recurse more than one level (if a folder is supplied, it will list
|
that directory structure.
|
||||||
files within)
|
|
||||||
"""
|
"""
|
||||||
filelist = []
|
filelist = []
|
||||||
|
|
||||||
for path in args:
|
if isinstance(args, list):
|
||||||
for root, dirs, files in os.walk(path, topdown=False):
|
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:
|
for name in files:
|
||||||
filelist.append(os.path.join(root, name))
|
filelist.append(os.path.join(root, name))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user