From 8a422e63f51412bef5c3e0f0e6b06c6af750c202 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Thu, 10 May 2012 13:30:40 -0400 Subject: Handle files that have upper case file extension --- comic-rename.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comic-rename.py b/comic-rename.py index 15b6046..93037de 100755 --- a/comic-rename.py +++ b/comic-rename.py @@ -7,14 +7,14 @@ import string def cleanup_filename(strname): (strfile, strext) = os.path.splitext(strname) strext = string.strip(strext) - if strext == '.cbr' or strext == '.cbz': + if strext.lower() == '.cbr' or strext.lower() == '.cbz': pattobj = re.compile("\(+(.*)") pattobj2 = re.compile("__") pattobj3 = re.compile("_") name = re.sub(pattobj, "", strfile) name = re.sub(pattobj2, " ", name) name = re.sub(pattobj3, " ", name) - return name.rstrip() + strext + return name.rstrip() + strext.lower() else: return '' -- cgit