Skip to content
Snippets Groups Projects
Commit 3368322a authored by ale's avatar ale
Browse files

ignore files that start with dots, and appledouble folders

parent d2ee60b3
No related branches found
No related tags found
No related merge requests found
import os
DIR_BLACKLIST = set(['.AppleDouble'])
def recursive_scan(basedir, queue):
n = 0
for root, dirs, files in os.walk(basedir):
for root, dirs, files in os.walk(basedir, topdown=True,
followlinks=True):
prune_dirs = [x for x in dirs
if (x in DIR_BLACKLIST or x.startswith('.'))]
for pdir in prune_dirs:
dirs.remove(pdir)
for filename in files:
if filename.lower().endswith('.mp3'):
if (filename.lower().endswith('.mp3') and
not filename.startswith('.')):
path = os.path.join(root, filename)
queue.put(path)
n += 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment