Revert "Replace path separators from config"

This reverts commit c82b31e750.

Conflicts:
	docs/changelog.rst
This commit is contained in:
Adrian Sampson 2014-02-13 13:22:45 -08:00
parent 8df31453c0
commit 23fb5da1dc
4 changed files with 6 additions and 31 deletions

View file

@ -375,10 +375,6 @@ class Model(object):
value = unicode(value)
if for_path:
replacements = self._db.replacements or []
for regex, repl in replacements:
value = regex.sub(repl, value)
sep_repl = beets.config['path_sep_replace'].get(unicode)
for sep in (os.path.sep, os.path.altsep):
if sep:

View file

@ -75,8 +75,6 @@ Other little fixes:
are now treated as directories. Thanks to Pedro Silva.
* The :ref:`modify-cmd` command now skips confirmation and prints a message if
no changes are necessary. Thanks to brilnius.
* The replacement characters for path separators can be set in the
"replace" configuration.
* :doc:`/plugins/fetchart`: When using the ``remote_priority`` config option,
local image files are no longer completely ignored.
* :doc:`/plugins/echonest`: Fix an issue causing the plugin to appear twice in

View file

@ -257,18 +257,14 @@ class Bag(object):
def platform_windows():
import ntpath
old_path = os.path
try:
os.path = ntpath
yield
finally:
os.path = old_path
os.path = ntpath
yield
os.path = old_path
@contextmanager
def platform_posix():
import posixpath
old_path = os.path
try:
os.path = posixpath
yield
finally:
os.path = old_path
os.path = posixpath
yield
os.path = old_path

View file

@ -248,21 +248,6 @@ class DestinationTest(_common.TestCase):
self.assertFalse('>' in p)
self.assertFalse('|' in p)
def test_replace_unix_path_separator_from_config(self):
self.i.title = 'one \\ two / three.mp3'
self.lib.replacements = [(re.compile(r'[\\/]'), 'x')]
with _common.platform_windows():
p = self.i.destination()
self.assertTrue('one x two x three.mp3' in p)
self.lib.replacements = None
def test_replace_windows_path_separator_from_config(self):
self.i.title = 'one \\ two / three.mp3'
self.lib.replacements = [(re.compile(r'[\\/]'), 'x')]
with _common.platform_windows():
p = self.i.destination()
self.assertTrue('one x two x three.mp3' in p)
def test_path_with_format(self):
self.lib.path_formats = [('default', '$artist/$album ($format)')]
p = self.i.destination()