mirror of
https://github.com/beetbox/beets.git
synced 2025-12-14 20:43:41 +01:00
replace: tolerate None replacements
Avoids confusion/traceback when you leave off the replacement string instead of using ''.
This commit is contained in:
parent
bc660ec47f
commit
cf3af711da
2 changed files with 6 additions and 2 deletions
|
|
@ -463,13 +463,15 @@ def get_replacements():
|
|||
"""
|
||||
replacements = []
|
||||
for pattern, repl in config['replace'].get(dict).items():
|
||||
repl = repl or ''
|
||||
try:
|
||||
replacements.append((re.compile(pattern), repl))
|
||||
except re.error:
|
||||
raise UserError(
|
||||
u'malformed regular expression in replace: {0}'.format(
|
||||
pattern
|
||||
))
|
||||
)
|
||||
)
|
||||
return replacements
|
||||
|
||||
def get_plugin_paths():
|
||||
|
|
|
|||
|
|
@ -63,11 +63,13 @@ Little fixes:
|
|||
Mathijs de Bruin.
|
||||
* The :ref:`clutter` option can now be a whitespace-separated list in addition
|
||||
to a YAML list.
|
||||
|
||||
* Values for the :ref:`replace` option can now be empty (i.e., null is
|
||||
equivalent to the empty string).
|
||||
|
||||
.. _Acoustic Attributes: http://developer.echonest.com/acoustic-attributes.html
|
||||
.. _MPD: http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki
|
||||
|
||||
|
||||
1.3.1 (October 12, 2013)
|
||||
------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue