]> Shamusworld >> Repos - ardour-manual-diverged/commitdiff
Changing the filename cleaning regex
authorEd Ward <edwsaintesprit@hotmail.com>
Thu, 2 Feb 2017 14:06:22 +0000 (15:06 +0100)
committerEd Ward <edwsaintesprit@hotmail.com>
Thu, 2 Feb 2017 14:06:22 +0000 (15:06 +0100)
build.py

index ec09ad657393f4e2ac4bd77146132355cdc029db..437ccf40d608fe9d7e250157cdd2995d8ef70cae 100755 (executable)
--- a/build.py
+++ b/build.py
@@ -23,8 +23,8 @@ import argparse
 # replaced with dashes.
 #
 def MakeFilename(s):
-       # This RE is shitty, but I can't think of a better one right now
-       fn = re.sub("[?!'&#:;_*()/\\,.]+", "", s)
+       # Cleans up the file name, removing all non ASCII or .-_ chars
+       fn = re.sub(r'[^.-_a-zA-Z0-9]', '', s)
        fn = fn.lower()
        fn = fn.replace(' ', '-')
        return fn
@@ -469,4 +469,3 @@ tocFile.close()
 
 if not quiet:
        print('Processed ' + str(fileCount) + ' files.')
-