Style changes

This commit is contained in:
Andrew Murray 2015-09-11 23:54:57 +10:00
parent 21459e9ab4
commit 64e733f552
2 changed files with 8 additions and 14 deletions

View File

@ -428,8 +428,7 @@ class ImageFileDirectory(collections.MutableMapping):
ifd = fp.read(12) ifd = fp.read(12)
if len(ifd) != 12: if len(ifd) != 12:
warnings.warn("Possibly corrupt EXIF data. " warnings.warn("Possibly corrupt EXIF data. Expecting to read 12 bytes but only got %d."
"Expecting to read 12 bytes but only got %d."
% (len(ifd))) % (len(ifd)))
continue continue
@ -467,9 +466,8 @@ class ImageFileDirectory(collections.MutableMapping):
data = ifd[8:8+size] data = ifd[8:8+size]
if len(data) != size: if len(data) != size:
warnings.warn("Possibly corrupt EXIF data. " warnings.warn("Possibly corrupt EXIF data. Expecting to read %d bytes but only got %d. Skipping tag %s"
"Expecting to read %d bytes but only got %d. " % (size, len(data), tag))
"Skipping tag %s" % (size, len(data), tag))
continue continue
self.tagdata[tag] = data self.tagdata[tag] = data
@ -484,8 +482,7 @@ class ImageFileDirectory(collections.MutableMapping):
ifd = fp.read(4) ifd = fp.read(4)
if len(ifd) != 4: if len(ifd) != 4:
warnings.warn("Possibly corrupt EXIF data. " warnings.warn("Possibly corrupt EXIF data. Expecting to read 4 bytes but only got %d."
"Expecting to read 4 bytes but only got %d."
% (len(ifd))) % (len(ifd)))
return return
@ -704,9 +701,8 @@ class TiffImageFile(ImageFile.ImageFile):
if not self.__next: if not self.__next:
raise EOFError("no more images in TIFF file") raise EOFError("no more images in TIFF file")
if DEBUG: if DEBUG:
print("Seeking to frame %s, on frame %s, " print("Seeking to frame %s, on frame %s, __next %s, location: %s"
"__next %s, location: %s" % % (frame, self.__frame, self.__next, self.fp.tell()))
(frame, self.__frame, self.__next, self.fp.tell()))
# reset python3 buffered io handle in case fp # reset python3 buffered io handle in case fp
# was passed to libtiff, invalidating the buffer # was passed to libtiff, invalidating the buffer
self.fp.tell() self.fp.tell()

View File

@ -75,10 +75,8 @@ def install():
pool = Pool(2) pool = Pool(2)
CCompiler.compile = _mp_compile CCompiler.compile = _mp_compile
except Exception as msg: except Exception as msg:
print("Exception installing mp_compile, proceeding without:" print("Exception installing mp_compile, proceeding without: %s" % msg)
"%s" % msg)
else: else:
print("Single threaded build, not installing mp_compile:" print("Single threaded build, not installing mp_compile: %s processes" % MAX_PROCS)
"%s processes" % MAX_PROCS)
install() install()