Small fixes, debug print

This commit is contained in:
Jeroen Goudsmit 2010-02-05 22:27:13 +01:00
parent a1811a0a74
commit 4fae39c67f

View file

@ -240,7 +240,7 @@ class Worker(QThread):
name = oldfile.fileName() name = oldfile.fileName()
oldfilesize = oldfile.size() oldfilesize = oldfile.size()
oldfilesizestr = size(oldfilesize, system=alternative) oldfilesizestr = size(oldfilesize, system=alternative)
print type(filename)
# get extention # get extention
baseName, extention = os.path.splitext(filename) baseName, extention = os.path.splitext(filename)
@ -248,13 +248,13 @@ class Worker(QThread):
if extention in ['.jpg', '.jpeg']: if extention in ['.jpg', '.jpeg']:
runString = 'jpegoptim -f --strip-all "%(file)s"' runString = 'jpegoptim -f --strip-all "%(file)s"'
elif extention in ['.png']: elif extention in ['.png']:
runString = 'optipng -force -o7 "%(file)s"; advpng -z4 "%(file)"' runString = 'optipng -force -o7 "%(file)s"; advpng -z4 "%(file)s"'
else: else:
# This probably should never happen... # This probably should never happen...
raise Exception('File %s does not have the appropriate extention' % filename) raise Exception('File %s does not have the appropriate extention' % filename)
try: try:
retcode = call(runString % {'file' : filename, shell = True, stdout = PIPE) retcode = call(runString % {'file' : filename}, shell = True, stdout = PIPE)
runfile = retcode runfile = retcode
except OSError, e: except OSError, e:
runfile = e runfile = e