Skip to content

Commit

Permalink
Flake8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Aug 25, 2015
1 parent 926a08c commit c6b13d2
Show file tree
Hide file tree
Showing 44 changed files with 168 additions and 173 deletions.
4 changes: 1 addition & 3 deletions PIL/BmpImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@
#


__version__ = "0.7"


from PIL import Image, ImageFile, ImagePalette, _binary
import math

__version__ = "0.7"

i8 = _binary.i8
i16 = _binary.i16le
Expand Down
3 changes: 1 addition & 2 deletions PIL/CurImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
#


__version__ = "0.1"

from PIL import Image, BmpImagePlugin, _binary

__version__ = "0.1"

#
# --------------------------------------------------------------------
Expand Down
5 changes: 2 additions & 3 deletions PIL/DcxImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
# See the README file for information on usage and redistribution.
#

__version__ = "0.2"

from PIL import Image, _binary

from PIL.PcxImagePlugin import PcxImageFile

__version__ = "0.2"

MAGIC = 0x3ADE68B1 # QUIZ: what's this value, then?

i32 = _binary.i32le
Expand Down
9 changes: 5 additions & 4 deletions PIL/EpsImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
# See the README file for information on usage and redistribution.
#

__version__ = "0.5"

import re
import io
import sys
from PIL import Image, ImageFile, _binary

__version__ = "0.5"

#
# --------------------------------------------------------------------

Expand All @@ -36,7 +37,6 @@
field = re.compile(r"^%[%!\w]([^:]*)[ \t]*$")

gs_windows_binary = None
import sys
if sys.platform.startswith('win'):
import shutil
if hasattr(shutil, 'which'):
Expand Down Expand Up @@ -187,7 +187,8 @@ def readline(self):


def _accept(prefix):
return prefix[:4] == b"%!PS" or (len(prefix) >= 4 and i32(prefix) == 0xC6D3D0C5)
return prefix[:4] == b"%!PS" or \
(len(prefix) >= 4 and i32(prefix) == 0xC6D3D0C5)

##
# Image plugin for Encapsulated Postscript. This plugin supports only
Expand Down
4 changes: 2 additions & 2 deletions PIL/FliImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
#


__version__ = "0.2"

from PIL import Image, ImageFile, ImagePalette, _binary

__version__ = "0.2"

i8 = _binary.i8
i16 = _binary.i16le
i32 = _binary.i32le
Expand Down
5 changes: 2 additions & 3 deletions PIL/FpxImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
#


__version__ = "0.1"


from PIL import Image, ImageFile
from PIL.OleFileIO import i8, i32, MAGIC, OleFileIO

__version__ = "0.1"


# we map from colour field tuples to (mode, rawmode) descriptors
MODES = {
Expand Down
4 changes: 2 additions & 2 deletions PIL/GdImageFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
# purposes only.


__version__ = "0.1"

from PIL import ImageFile, ImagePalette, _binary
from PIL._util import isPath

__version__ = "0.1"

try:
import builtins
except ImportError:
Expand Down
4 changes: 2 additions & 2 deletions PIL/IcoImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
# * http://msdn.microsoft.com/en-us/library/ms997538.aspx


__version__ = "0.1"

import struct
from io import BytesIO

from PIL import Image, ImageFile, BmpImagePlugin, PngImagePlugin, _binary
from math import log, ceil

__version__ = "0.1"

#
# --------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions PIL/ImImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#


__version__ = "0.7"

import re
from PIL import Image, ImageFile, ImagePalette
from PIL._binary import i8

__version__ = "0.7"


# --------------------------------------------------------------------
# Standard tags
Expand Down
2 changes: 1 addition & 1 deletion PIL/ImageFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import logging
import os
import sys
import traceback
# import traceback

logger = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion PIL/ImageFont.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ def truetype(font=None, size=10, index=0, encoding="", filename=None):
# According to the freedesktop spec, XDG_DATA_DIRS should
# default to /usr/share
lindirs = '/usr/share'
dirs += [os.path.join(lindir, "fonts") for lindir in lindirs.split(":")]
dirs += [os.path.join(lindir, "fonts")
for lindir in lindirs.split(":")]
elif sys.platform == 'darwin':
dirs += ['/Library/Fonts', '/System/Library/Fonts',
os.path.expanduser('~/Library/Fonts')]
Expand Down
4 changes: 2 additions & 2 deletions PIL/ImagePalette.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ def load(filename):
p = PaletteFile.PaletteFile(fp)
lut = p.getpalette()
except (SyntaxError, ValueError):
#import traceback
#traceback.print_exc()
# import traceback
# traceback.print_exc()
pass

if not lut:
Expand Down
5 changes: 3 additions & 2 deletions PIL/ImtImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
#


__version__ = "0.2"

import re

from PIL import Image, ImageFile

__version__ = "0.2"


#
# --------------------------------------------------------------------

Expand Down
5 changes: 2 additions & 3 deletions PIL/IptcImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@

from __future__ import print_function

__version__ = "0.3"


from PIL import Image, ImageFile, _binary
import os
import tempfile

__version__ = "0.3"

i8 = _binary.i8
i16 = _binary.i16be
i32 = _binary.i32be
Expand Down
20 changes: 10 additions & 10 deletions PIL/JpegImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
# See the README file for information on usage and redistribution.
#

__version__ = "0.6"

import array
import struct
import io
Expand All @@ -48,6 +46,8 @@
i16 = _binary.i16be
i32 = _binary.i32be

__version__ = "0.6"


#
# Parser
Expand Down Expand Up @@ -528,14 +528,14 @@ def _getmp(self):
"YCbCr": "YCbCr",
}

zigzag_index = ( 0, 1, 5, 6, 14, 15, 27, 28,
2, 4, 7, 13, 16, 26, 29, 42,
3, 8, 12, 17, 25, 30, 41, 43,
9, 11, 18, 24, 31, 40, 44, 53,
10, 19, 23, 32, 39, 45, 52, 54,
20, 22, 33, 38, 46, 51, 55, 60,
21, 34, 37, 47, 50, 56, 59, 61,
35, 36, 48, 49, 57, 58, 62, 63)
zigzag_index = (0, 1, 5, 6, 14, 15, 27, 28,
2, 4, 7, 13, 16, 26, 29, 42,
3, 8, 12, 17, 25, 30, 41, 43,
9, 11, 18, 24, 31, 40, 44, 53,
10, 19, 23, 32, 39, 45, 52, 54,
20, 22, 33, 38, 46, 51, 55, 60,
21, 34, 37, 47, 50, 56, 59, 61,
35, 36, 48, 49, 57, 58, 62, 63)

samplings = {(1, 1, 1, 1, 1, 1): 0,
(2, 1, 1, 1, 1, 1): 1,
Expand Down
Loading

0 comments on commit c6b13d2

Please sign in to comment.