reformatted

This commit is contained in:
Wolfgang Nowak 2024-09-04 19:08:51 +02:00
parent 3e39d519c9
commit e514ad8f42

4
cleanfilenames.py Normal file → Executable file
View file

@ -2,7 +2,7 @@
import sys, re, os import sys, re, os
errortxt = " mydirectory\nRenames _all_ strange filenames in a given directory. No other options, edit the source." errortxt = " /some/directory\nRenames _all_ strange filenames in a given directory. No other options, edit the source."
count = 0 count = 0
# Check for one single commandlineparameter # Check for one single commandlineparameter
@ -13,8 +13,10 @@ except:
# Regex to eliminate everything not belonging into a filename # Regex to eliminate everything not belonging into a filename
# Ey, this is not zombiecode! # Ey, this is not zombiecode!
# whitelist = "[^a-z.A-Z0-9äöüÄÖÜß_+-]" # All trash eliminate # whitelist = "[^a-z.A-Z0-9äöüÄÖÜß_+-]" # All trash eliminate
# whitelist = "[^a-z.A-Z0-9äöüÄÖÜß_+-][^a-z.A-Z0-9äöüÄÖÜß_+-]*" # Reduce trash to "-" # whitelist = "[^a-z.A-Z0-9äöüÄÖÜß_+-][^a-z.A-Z0-9äöüÄÖÜß_+-]*" # Reduce trash to "-"
whitelist = "[^a-z.A-Z0-9äöüÄÖÜß_+-][^a-z.A-Z0-9äöüÄÖÜß_+-]*" whitelist = "[^a-z.A-Z0-9äöüÄÖÜß_+-][^a-z.A-Z0-9äöüÄÖÜß_+-]*"
cutminus = "^-+" cutminus = "^-+"