put space before colon

This commit is contained in:
Thomas Vander Stichele
2013-07-29 12:29:06 +02:00
parent 30e717b36b
commit 430ee02a71
2 changed files with 9 additions and 3 deletions

View File

@@ -45,8 +45,9 @@ class PathFilter(object):
path = re.sub(r'[/\\]', '-', path, re.UNICODE)
def separators(path):
# replace separators with a hyphen
path = re.sub(r'[:\|]', '-', path, re.UNICODE)
# replace separators with a space-hyphen or hyphen
path = re.sub(r'[:]', ' -', path, re.UNICODE)
path = re.sub(r'[\|]', '-', path, re.UNICODE)
return path
# change all fancy single/double quotes to normal quotes

View File

@@ -17,9 +17,14 @@ class FilterTestCase(common.TestCase):
def testFat(self):
part = u'A Word: F**k you?'
self.assertEquals(self._filter.filter(part), u'A Word- F__k you_')
self.assertEquals(self._filter.filter(part), u'A Word - F__k you_')
def testSpecial(self):
part = u'<<< $&*!\' "()`{}[]spaceship>>>'
self.assertEquals(self._filter.filter(part),
u'___ _____ ________spaceship___')
def testGreatest(self):
part = u'Greatest Ever! Soul: The Definitive Collection'
self.assertEquals(self._filter.filter(part),
u'Greatest Ever_ Soul - The Definitive Collection')