From e514ad8f4281c5610a685f1b715653188edb04f5 Mon Sep 17 00:00:00 2001 From: Wolfgang Nowak Date: Wed, 4 Sep 2024 19:08:51 +0200 Subject: [PATCH] reformatted --- cleanfilenames.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) mode change 100644 => 100755 cleanfilenames.py diff --git a/cleanfilenames.py b/cleanfilenames.py old mode 100644 new mode 100755 index a3f28c2..e77fa7d --- a/cleanfilenames.py +++ b/cleanfilenames.py @@ -2,7 +2,7 @@ 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 # Check for one single commandlineparameter @@ -13,8 +13,10 @@ except: # Regex to eliminate everything not belonging into a filename # Ey, this is not zombiecode! -# 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äöüÄÖÜß_+-]" # 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äöüÄÖÜß_+-]*" cutminus = "^-+"