mirror of
https://github.com/nikdoof/tvorganise.git
synced 2025-12-13 06:42:16 +00:00
Refactor find_files to use os.walk instead.
This commit is contained in:
@@ -30,14 +30,11 @@ def find_files(args):
|
|||||||
files within)
|
files within)
|
||||||
"""
|
"""
|
||||||
filelist = []
|
filelist = []
|
||||||
for cfile in args:
|
|
||||||
if os.path.isdir(cfile):
|
for root, dirs, files in os.walk(args, topdown=False):
|
||||||
for sf in os.listdir(cfile):
|
for name in files:
|
||||||
newpath = os.path.join(cfile, sf)
|
filelist.append(os.path.join(root, name))
|
||||||
if os.path.isfile(newpath):
|
|
||||||
filelist.append(newpath)
|
|
||||||
elif os.path.isfile(cfile):
|
|
||||||
filelist.append(cfile)
|
|
||||||
return filelist
|
return filelist
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user