[SCM] morituri/master: More quote fixing

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:10:05 UTC 2014


The following commit has been merged in the master branch:
commit 948835a257d1c3e09832594e68e12af3b5844769
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sat Jul 13 23:03:46 2013 +0200

    More quote fixing

diff --git a/morituri/common/path.py b/morituri/common/path.py
index b7f39e8..8612e92 100644
--- a/morituri/common/path.py
+++ b/morituri/common/path.py
@@ -44,15 +44,24 @@ class PathFilter(object):
         if self._slashes:
             path = re.sub(r'[/\\]', '-', path, re.UNICODE)
 
+        def separators(path):
+            # replace separators with a hyphen
+            path = re.sub(r'[:\|]', '-', path, re.UNICODE)
+            return path
+
+        # change all fancy single/double quotes to normal quotes
         if self._quotes:
-            path = re.sub(ur'[\u2019]', "'", path, re.UNICODE)
+            path = re.sub(ur'[\xc2\xb4\u2018\u2019\u201b]', "'", path,
+                re.UNICODE)
+            path = re.sub(ur'[\u201c\u201d\u201f]', '"', path, re.UNICODE)
 
         if self._special:
-            # replace separators with a hyphen
-            path = re.sub(r'[:\|]', '-', path, re.UNICODE)
+            path = separators(path)
             path = re.sub(r'[\*\?&!\'\"\$\(\)`{}\[\]<>]', '_', path, re.UNICODE)
 
         if self._fat:
+            path = separators(path)
+            # : and | already gone, but leave them here for reference
             path = re.sub(r'[:\*\?"<>|"]', '_', path, re.UNICODE)
 
         return path

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list