Skip to content

Commit

Permalink
Various Flake8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Apr 23, 2015
1 parent 40165d6 commit d1c182c
Show file tree
Hide file tree
Showing 40 changed files with 201 additions and 230 deletions.
3 changes: 3 additions & 0 deletions PIL/FitsStubImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@
#
# @param handler Handler object.


def register_handler(handler):
global _handler
_handler = handler

# --------------------------------------------------------------------
# Image adapter


def _accept(prefix):
return prefix[:6] == b"SIMPLE"


class FITSStubImageFile(ImageFile.StubImageFile):

format = "FITS"
Expand Down
4 changes: 2 additions & 2 deletions PIL/FpxImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def _open_subimage(self, index=1, subimage=0):
s = fp.read(36)

size = i32(s, 4), i32(s, 8)
#tilecount = i32(s, 12)
# tilecount = i32(s, 12)
tilesize = i32(s, 16), i32(s, 20)
#channels = i32(s, 24)
# channels = i32(s, 24)
offset = i32(s, 28)
length = i32(s, 32)

Expand Down
4 changes: 2 additions & 2 deletions PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def init():
for plugin in _plugins:
try:
if DEBUG:
print ("Importing %s" % plugin)
print("Importing %s" % plugin)
__import__("PIL.%s" % plugin, globals(), locals(), [])
except ImportError:
if DEBUG:
Expand Down Expand Up @@ -546,7 +546,7 @@ def close(self):
self.fp.close()
except Exception as msg:
if DEBUG:
print ("Error closing: %s" % msg)
print("Error closing: %s" % msg)

# Instead of simply setting to None, we're setting up a
# deferred error that will better explain that the core image
Expand Down
1 change: 1 addition & 0 deletions PIL/ImageEnhance.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def __init__(self, image):

self.degenerate = image.convert(self.intermediate_mode).convert(image.mode)


class Contrast(_Enhance):
"""Adjust image contrast.
Expand Down
3 changes: 2 additions & 1 deletion PIL/ImageQt.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
except:
from PySide.QtGui import QImage, qRgba

else: #PyQt4 is used
else: #PyQt4 is used
from PyQt4.QtGui import QImage, qRgba

##
# (Internal) Turns an RGB color into a Qt compatible color integer.


def rgb(r, g, b, a=255):
# use qRgb to pack the colors, and then turn the resulting long
# into a negative integer with the same bitpattern.
Expand Down
2 changes: 1 addition & 1 deletion PIL/JpegImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def validate_qtables(qtables):
# https://github.com/jdriscoll/django-imagekit/issues/50
bufsize = 0
if "optimize" in info or "progressive" in info or "progression" in info:
# keep sets quality to 0, but the actual value may be high.
# keep sets quality to 0, but the actual value may be high.
if quality >= 95 or quality == 0:
bufsize = 2 * im.size[0] * im.size[1]
else:
Expand Down
18 changes: 9 additions & 9 deletions PIL/JpegPresets.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"""

presets = {
'web_low': {'subsampling': 2, # "4:1:1"
'web_low': {'subsampling': 2, # "4:1:1"
'quantization': [
[20, 16, 25, 39, 50, 46, 62, 68,
16, 18, 23, 38, 38, 53, 65, 68,
Expand All @@ -86,7 +86,7 @@
68, 68, 68, 68, 68, 68, 68, 68,
68, 68, 68, 68, 68, 68, 68, 68]
]},
'web_medium': {'subsampling': 2, # "4:1:1"
'web_medium': {'subsampling': 2, # "4:1:1"
'quantization': [
[16, 11, 11, 16, 23, 27, 31, 30,
11, 12, 12, 15, 20, 23, 23, 30,
Expand All @@ -105,7 +105,7 @@
38, 35, 46, 53, 64, 64, 64, 64,
48, 43, 53, 64, 64, 64, 64, 64]
]},
'web_high': {'subsampling': 0, # "4:4:4"
'web_high': {'subsampling': 0, # "4:4:4"
'quantization': [
[ 6, 4, 4, 6, 9, 11, 12, 16,
4, 5, 5, 6, 8, 10, 12, 12,
Expand All @@ -124,7 +124,7 @@
31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31]
]},
'web_very_high': {'subsampling': 0, # "4:4:4"
'web_very_high': {'subsampling': 0, # "4:4:4"
'quantization': [
[ 2, 2, 2, 2, 3, 4, 5, 6,
2, 2, 2, 2, 3, 4, 5, 6,
Expand All @@ -143,7 +143,7 @@
15, 12, 12, 12, 12, 12, 12, 12,
15, 12, 12, 12, 12, 12, 12, 12]
]},
'web_maximum': {'subsampling': 0, # "4:4:4"
'web_maximum': {'subsampling': 0, # "4:4:4"
'quantization': [
[ 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
Expand All @@ -162,7 +162,7 @@
3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3]
]},
'low': {'subsampling': 2, # "4:1:1"
'low': {'subsampling': 2, # "4:1:1"
'quantization': [
[18, 14, 14, 21, 30, 35, 34, 17,
14, 16, 16, 19, 26, 23, 12, 12,
Expand All @@ -181,7 +181,7 @@
17, 12, 12, 12, 12, 12, 12, 12,
17, 12, 12, 12, 12, 12, 12, 12]
]},
'medium': {'subsampling': 2, # "4:1:1"
'medium': {'subsampling': 2, # "4:1:1"
'quantization': [
[12, 8, 8, 12, 17, 21, 24, 17,
8, 9, 9, 11, 15, 19, 12, 12,
Expand All @@ -200,7 +200,7 @@
17, 12, 12, 12, 12, 12, 12, 12,
17, 12, 12, 12, 12, 12, 12, 12]
]},
'high': {'subsampling': 0, # "4:4:4"
'high': {'subsampling': 0, # "4:4:4"
'quantization': [
[ 6, 4, 4, 6, 9, 11, 12, 16,
4, 5, 5, 6, 8, 10, 12, 12,
Expand All @@ -219,7 +219,7 @@
17, 12, 12, 12, 12, 12, 12, 12,
17, 12, 12, 12, 12, 12, 12, 12]
]},
'maximum': {'subsampling': 0, # "4:4:4"
'maximum': {'subsampling': 0, # "4:4:4"
'quantization': [
[ 2, 2, 2, 2, 3, 4, 5, 6,
2, 2, 2, 2, 3, 4, 5, 6,
Expand Down
Loading

0 comments on commit d1c182c

Please sign in to comment.