changelog, docs, and style tweaks for #93

This commit is contained in:
Adrian Sampson 2013-02-04 22:44:04 -08:00
parent ef5c23e184
commit d544c832c7
4 changed files with 19 additions and 10 deletions

View file

@ -513,11 +513,9 @@ class ImportTask(object):
call when the file in question may not have been removed.
"""
if self.toppath and not os.path.exists(filename):
util.prune_dirs(
os.path.dirname(filename),
self.toppath,
clutter=config['clutter'].get(list)
)
util.prune_dirs(os.path.dirname(filename),
self.toppath,
clutter=config['clutter'].get(list))
# Full-album pipeline stages.

View file

@ -194,9 +194,8 @@ def mkdirall(path):
traceback.format_exc())
def fnmatch_all(names, patterns):
"""
`names` and `patterns` should be iterables.
Returns True if all names match any of the patterns.
"""Determine whether all strings in `names` match at least one of
the `patterns`, which should be shell glob expressions.
"""
for name in names:
matches = False
@ -204,7 +203,7 @@ def fnmatch_all(names, patterns):
matches = fnmatch.fnmatch(name, pattern)
if matches:
break
if not matches:
if not matches:
return False
return True
@ -244,7 +243,7 @@ def prune_dirs(path, root=None, clutter=('.DS_Store', 'Thumbs.db')):
try:
shutil.rmtree(directory)
except OSError:
break
break
else:
break

View file

@ -10,6 +10,8 @@ New configuration options:
is when considering a candidate.
* :ref:`none_rec_action` lets you skip the prompt, and automatically choose an
action, when there is no good candidate. Thanks to mrmachine.
* :ref:`clutter` controls which files should be ignored when cleaning up empty
directories. Thanks to Steinþór Pálsson.
* :doc:`/plugins/lastgenre`: A new configuration option lets you choose to
retrieve artist-level tags as genres instead of album- or track-level tags.
Thanks to Peter Fern.

View file

@ -179,6 +179,16 @@ environment variables.
.. _known to python: http://docs.python.org/2/library/codecs.html#standard-encodings
.. _clutter:
clutter
-------
When beets imports all the files in a directory, it tries to remove the
directory if it's empty. A directory is considered empty if it only contains
files whose names match the glob patterns in `clutter`, which should be a list
of strings. The default list consists of "Thumbs.DB" and ".DS_Store".
Importer Options
----------------