Various Flake8 Scripts fixes

This commit is contained in:
Andrew Murray 2015-04-24 09:41:33 +10:00
parent d1c182cadc
commit 86be744d1f
12 changed files with 43 additions and 22 deletions

View File

@ -18,6 +18,7 @@ import sys
# #
# enhancer widget # enhancer widget
class Enhance(Frame): class Enhance(Frame):
def __init__(self, master, image, name, enhancer, lo, hi): def __init__(self, master, image, name, enhancer, lo, hi):
Frame.__init__(self, master) Frame.__init__(self, master)

View File

@ -9,7 +9,9 @@
from __future__ import print_function from __future__ import print_function
from PIL import Image from PIL import Image
import os, sys import os
import sys
class Interval: class Interval:

View File

@ -49,9 +49,11 @@ from PIL.GifImagePlugin import getheader, getdata
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# sequence iterator # sequence iterator
class image_sequence: class image_sequence:
def __init__(self, im): def __init__(self, im):
self.im = im self.im = im
def __getitem__(self, ix): def __getitem__(self, ix):
try: try:
if ix: if ix:
@ -63,6 +65,7 @@ class image_sequence:
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# straightforward delta encoding # straightforward delta encoding
def makedelta(fp, sequence): def makedelta(fp, sequence):
"""Convert list of image frames to a GIF animation file""" """Convert list of image frames to a GIF animation file"""
@ -109,6 +112,7 @@ def makedelta(fp, sequence):
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# main hack # main hack
def compress(infile, outfile): def compress(infile, outfile):
# open input image, and force loading of first frame # open input image, and force loading of first frame

View File

@ -20,6 +20,7 @@ import sys
# #
# painter widget # painter widget
class PaintCanvas(Canvas): class PaintCanvas(Canvas):
def __init__(self, master, image): def __init__(self, master, image):
Canvas.__init__(self, master, width=image.size[0], height=image.size[1]) Canvas.__init__(self, master, width=image.size[0], height=image.size[1])

View File

@ -15,10 +15,13 @@
from __future__ import print_function from __future__ import print_function
import getopt, string, sys import getopt
import string
import sys
from PIL import Image from PIL import Image
def usage(): def usage():
print("PIL Convert 0.5/1998-12-30 -- convert image files") print("PIL Convert 0.5/1998-12-30 -- convert image files")
print("Usage: pilconvert [option] infile outfile") print("Usage: pilconvert [option] infile outfile")

View File

@ -52,6 +52,7 @@ from __future__ import print_function
from PIL import Image from PIL import Image
class PILDriver: class PILDriver:
verbose = 0 verbose = 0

View File

@ -20,7 +20,9 @@
from __future__ import print_function from __future__ import print_function
import site import site
import getopt, glob, sys import getopt
import glob
import sys
from PIL import Image from PIL import Image
@ -59,6 +61,7 @@ for o, a in opt:
elif o == "-D": elif o == "-D":
Image.DEBUG += 1 Image.DEBUG += 1
def globfix(files): def globfix(files):
# expand wildcards where necessary # expand wildcards where necessary
if sys.platform == "win32": if sys.platform == "win32":

View File

@ -14,7 +14,8 @@ from __future__ import print_function
VERSION = "0.4" VERSION = "0.4"
import glob, sys import glob
import sys
# drivers # drivers
from PIL import BdfFontFile from PIL import BdfFontFile

View File

@ -12,7 +12,9 @@
# #
from __future__ import print_function from __future__ import print_function
import getopt, os, sys import getopt
import os
import sys
VERSION = "pilprint 0.3/2003-05-05" VERSION = "pilprint 0.3/2003-05-05"
@ -21,6 +23,7 @@ from PIL import PSDraw
letter = (1.0*72, 1.0*72, 7.5*72, 10.0*72) letter = (1.0*72, 1.0*72, 7.5*72, 10.0*72)
def description(file, image): def description(file, image):
title = os.path.splitext(os.path.split(file)[1])[0] title = os.path.splitext(os.path.split(file)[1])[0]
format = " (%dx%d " format = " (%dx%d "

View File

@ -18,6 +18,7 @@ import sys
# #
# an image viewer # an image viewer
class UI(Frame): class UI(Frame):
def __init__(self, master, im, value=128): def __init__(self, master, im, value=128):
Frame.__init__(self, master) Frame.__init__(self, master)

View File

@ -16,6 +16,7 @@ from PIL import Image, ImageTk
# #
# an image viewer # an image viewer
class UI(Label): class UI(Label):
def __init__(self, master, im): def __init__(self, master, im):