summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Pepple <bpepple@fedoraproject.org>2012-05-10 13:30:40 -0400
committerBrian Pepple <bpepple@fedoraproject.org>2012-05-10 13:30:40 -0400
commit8a422e63f51412bef5c3e0f0e6b06c6af750c202 (patch)
tree4e70b5258549db3a83f24ba09e795200da634c8d
parent68a86ca0b99af9b15ba717c6459c6eefb736a072 (diff)
downloadscripts-8a422e63f51412bef5c3e0f0e6b06c6af750c202.tar.gz
scripts-8a422e63f51412bef5c3e0f0e6b06c6af750c202.tar.xz
scripts-8a422e63f51412bef5c3e0f0e6b06c6af750c202.zip
Handle files that have upper case file extension
-rwxr-xr-xcomic-rename.py4
1 files 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 ''