def copy_other(opts, flacdir, outdir):
if opts.verbose:
print('COPYING other files')
for dirpath, dirs, files in os.walk(flacdir, topdown=False):
for name in files:
if opts.nolog and fnmatch(name.lower(), '*.log'):
continue
if opts.nocue and fnmatch(name.lower(), '*.cue'):
continue
if opts.nodots and fnmatch(name.lower(), '^.'):
continue
if (not fnmatch(name.lower(), '*.flac')
and not fnmatch(name.lower(), '*.m3u')):
d = re.sub(re.escape(flacdir), outdir, dirpath)
if (os.path.exists(os.path.join(d, name))
and not opts.overwrite):
continue
if not os.path.exists(d):
os.makedirs(d)
shutil.copy(os.path.join(dirpath, name), d)
评论列表
文章目录