diff --git a/PIL/ContainerIO.py b/PIL/ContainerIO.py index dcedcd6dd9f..262f2afb942 100644 --- a/PIL/ContainerIO.py +++ b/PIL/ContainerIO.py @@ -19,7 +19,7 @@ # file (for example a TAR file). -class ContainerIO: +class ContainerIO(object): ## # Create file object. diff --git a/PIL/EpsImagePlugin.py b/PIL/EpsImagePlugin.py index e2e7fa5e999..7b1f4c1ca94 100644 --- a/PIL/EpsImagePlugin.py +++ b/PIL/EpsImagePlugin.py @@ -157,7 +157,7 @@ def Ghostscript(tile, size, fp, scale=1): return im -class PSFile: +class PSFile(object): """ Wrapper for bytesio object that treats either CR or LF as end of line. """ @@ -365,7 +365,7 @@ def _save(im, fp, filename, eps=1): else: raise ValueError("image mode is not supported") - class NoCloseStream: + class NoCloseStream(object): def __init__(self, fp): self.fp = fp diff --git a/PIL/FontFile.py b/PIL/FontFile.py index 5cf68825656..db8e6bec150 100644 --- a/PIL/FontFile.py +++ b/PIL/FontFile.py @@ -31,7 +31,7 @@ def puti16(fp, values): ## # Base class for raster font file handlers. -class FontFile: +class FontFile(object): bitmap = None diff --git a/PIL/GifImagePlugin.py b/PIL/GifImagePlugin.py index 8db42e8e8cf..d2b2f7feebc 100644 --- a/PIL/GifImagePlugin.py +++ b/PIL/GifImagePlugin.py @@ -496,7 +496,7 @@ def getdata(im, offset=(0, 0), **params): The first string is a local image header, the rest contains encoded image data.""" - class Collector: + class Collector(object): data = [] def write(self, data): diff --git a/PIL/GimpGradientFile.py b/PIL/GimpGradientFile.py index 696f425f197..45af573bb22 100644 --- a/PIL/GimpGradientFile.py +++ b/PIL/GimpGradientFile.py @@ -58,7 +58,7 @@ def sphere_decreasing(middle, pos): SEGMENTS = [linear, curved, sine, sphere_increasing, sphere_decreasing] -class GradientFile: +class GradientFile(object): gradient = None diff --git a/PIL/GimpPaletteFile.py b/PIL/GimpPaletteFile.py index a066c80ccbd..4bf3ca36ab5 100644 --- a/PIL/GimpPaletteFile.py +++ b/PIL/GimpPaletteFile.py @@ -21,7 +21,7 @@ ## # File handler for GIMP's palette format. -class GimpPaletteFile: +class GimpPaletteFile(object): rawmode = "RGB" diff --git a/PIL/IcnsImagePlugin.py b/PIL/IcnsImagePlugin.py index 1bb1066d8d5..e0b130e819b 100644 --- a/PIL/IcnsImagePlugin.py +++ b/PIL/IcnsImagePlugin.py @@ -130,7 +130,7 @@ def read_png_or_jpeg2000(fobj, start_length, size): raise ValueError('Unsupported icon subimage format') -class IcnsFile: +class IcnsFile(object): SIZES = { (512, 512, 2): [ diff --git a/PIL/IcoImagePlugin.py b/PIL/IcoImagePlugin.py index c4e24d99c21..8a21444637f 100644 --- a/PIL/IcoImagePlugin.py +++ b/PIL/IcoImagePlugin.py @@ -79,7 +79,7 @@ def _accept(prefix): return prefix[:4] == _MAGIC -class IcoFile: +class IcoFile(object): def __init__(self, buf): """ Parse image from file-like object containing ico file data diff --git a/PIL/Image.py b/PIL/Image.py index 37428ec305a..274e7ee0e8c 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -35,7 +35,7 @@ class DecompressionBombWarning(RuntimeWarning): pass -class _imaging_not_installed: +class _imaging_not_installed(object): # module placeholder def __getattr__(self, id): raise ImportError("The _imaging C module is not installed") @@ -443,7 +443,7 @@ def coerce_e(value): return value if isinstance(value, _E) else _E(value) -class _E: +class _E(object): def __init__(self, data): self.data = data @@ -478,7 +478,7 @@ def _getscaleoffset(expr): # -------------------------------------------------------------------- # Implementation wrapper -class Image: +class Image(object): """ This class represents an image object. To create :py:class:`~PIL.Image.Image` objects, use the appropriate factory @@ -1975,12 +1975,12 @@ def load(self): # -------------------------------------------------------------------- # Abstract handlers. -class ImagePointHandler: +class ImagePointHandler(object): # used as a mixin by point transforms (for use with im.point) pass -class ImageTransformHandler: +class ImageTransformHandler(object): # used as a mixin by geometry transforms (for use with im.transform) pass diff --git a/PIL/ImageCms.py b/PIL/ImageCms.py index ed219f7ba00..6cd2f5d2d37 100644 --- a/PIL/ImageCms.py +++ b/PIL/ImageCms.py @@ -147,7 +147,7 @@ ## # Profile. -class ImageCmsProfile: +class ImageCmsProfile(object): def __init__(self, profile): """ diff --git a/PIL/ImageDraw.py b/PIL/ImageDraw.py index a2a75d1c6de..1fc5b4d610f 100644 --- a/PIL/ImageDraw.py +++ b/PIL/ImageDraw.py @@ -47,7 +47,7 @@ # Application code should use the Draw factory, instead of # directly. -class ImageDraw: +class ImageDraw(object): ## # Create a drawing instance. diff --git a/PIL/ImageDraw2.py b/PIL/ImageDraw2.py index c967a200f4b..62ee1163079 100644 --- a/PIL/ImageDraw2.py +++ b/PIL/ImageDraw2.py @@ -19,25 +19,25 @@ from PIL import Image, ImageColor, ImageDraw, ImageFont, ImagePath -class Pen: +class Pen(object): def __init__(self, color, width=1, opacity=255): self.color = ImageColor.getrgb(color) self.width = width -class Brush: +class Brush(object): def __init__(self, color, opacity=255): self.color = ImageColor.getrgb(color) -class Font: +class Font(object): def __init__(self, color, file, size=12): # FIXME: add support for bitmap fonts self.color = ImageColor.getrgb(color) self.font = ImageFont.truetype(file, size) -class Draw: +class Draw(object): def __init__(self, image, size=None, color=None): if not hasattr(image, "im"): diff --git a/PIL/ImageEnhance.py b/PIL/ImageEnhance.py index 8c0f166f3e1..fbacbee8f04 100644 --- a/PIL/ImageEnhance.py +++ b/PIL/ImageEnhance.py @@ -21,7 +21,7 @@ from PIL import Image, ImageFilter, ImageStat -class _Enhance: +class _Enhance(object): def enhance(self, factor): """ diff --git a/PIL/ImageFile.py b/PIL/ImageFile.py index 01c3e0303b9..b1d261166c8 100644 --- a/PIL/ImageFile.py +++ b/PIL/ImageFile.py @@ -311,7 +311,7 @@ def _load(self): ) -class Parser: +class Parser(object): """ Incremental image parser. This class implements the standard feed/close consumer interface. diff --git a/PIL/ImageFont.py b/PIL/ImageFont.py index 1e5a27f7b25..58889b6e553 100644 --- a/PIL/ImageFont.py +++ b/PIL/ImageFont.py @@ -38,7 +38,7 @@ warnings = None -class _imagingft_not_installed: +class _imagingft_not_installed(object): # module placeholder def __getattr__(self, id): raise ImportError("The _imagingft C module is not installed") @@ -64,7 +64,7 @@ def __getattr__(self, id): # -------------------------------------------------------------------- -class ImageFont: +class ImageFont(object): "PIL font wrapper" def _load_pilfont(self, filename): @@ -120,7 +120,7 @@ def _load_pilfont_data(self, file, image): # Wrapper for FreeType fonts. Application code should use the # truetype factory function to create font objects. -class FreeTypeFont: +class FreeTypeFont(object): "FreeType font wrapper (requires _imagingft service)" def __init__(self, font=None, size=10, index=0, encoding="", file=None): @@ -193,7 +193,7 @@ def font_variant(self, font=None, size=None, index=None, encoding=None): # Image.ROTATE_90, Image.ROTATE_180, or Image.ROTATE_270. -class TransposedFont: +class TransposedFont(object): "Wrapper for writing rotated or mirrored text" def __init__(self, font, orientation=None): diff --git a/PIL/ImageMath.py b/PIL/ImageMath.py index 4dcc5125cf1..f92d5001f9f 100644 --- a/PIL/ImageMath.py +++ b/PIL/ImageMath.py @@ -31,7 +31,7 @@ def _isconstant(v): return isinstance(v, int) or isinstance(v, float) -class _Operand: +class _Operand(object): # wraps an image operand, providing standard operators def __init__(self, im): diff --git a/PIL/ImageMode.py b/PIL/ImageMode.py index 29506910898..d8960017b59 100644 --- a/PIL/ImageMode.py +++ b/PIL/ImageMode.py @@ -20,7 +20,7 @@ ## # Wrapper for mode strings. -class ModeDescriptor: +class ModeDescriptor(object): def __init__(self, mode, bands, basemode, basetype): self.mode = mode diff --git a/PIL/ImageMorph.py b/PIL/ImageMorph.py index 996eacb7d69..6f92e9e672b 100644 --- a/PIL/ImageMorph.py +++ b/PIL/ImageMorph.py @@ -12,7 +12,7 @@ LUT_SIZE = 1 << 9 -class LutBuilder: +class LutBuilder(object): """A class for building a MorphLut from a descriptive language The input patterns is a list of a strings sequences like these:: @@ -176,7 +176,7 @@ def build_lut(self): return self.lut -class MorphOp: +class MorphOp(object): """A class for binary morphological operators""" def __init__(self, diff --git a/PIL/ImagePalette.py b/PIL/ImagePalette.py index c6c05d16260..b2f51dd069e 100644 --- a/PIL/ImagePalette.py +++ b/PIL/ImagePalette.py @@ -21,7 +21,7 @@ from PIL import ImageColor -class ImagePalette: +class ImagePalette(object): "Color palette for palette mapped images" def __init__(self, mode="RGB", palette=None, size=0): diff --git a/PIL/ImagePath.py b/PIL/ImagePath.py index 656d5ce617b..f23d01430ca 100644 --- a/PIL/ImagePath.py +++ b/PIL/ImagePath.py @@ -20,7 +20,7 @@ # the Python class below is overridden by the C implementation. -class Path: +class Path(object): def __init__(self, xy): pass diff --git a/PIL/ImageSequence.py b/PIL/ImageSequence.py index dd01e2902f0..256bcbedb35 100644 --- a/PIL/ImageSequence.py +++ b/PIL/ImageSequence.py @@ -16,7 +16,7 @@ ## -class Iterator: +class Iterator(object): """ This class implements an iterator object that can be used to loop over an image sequence. diff --git a/PIL/ImageShow.py b/PIL/ImageShow.py index 9527dbf971b..51417c30bd7 100644 --- a/PIL/ImageShow.py +++ b/PIL/ImageShow.py @@ -56,7 +56,7 @@ def show(image, title=None, **options): ## # Base class for viewers. -class Viewer: +class Viewer(object): # main api diff --git a/PIL/ImageStat.py b/PIL/ImageStat.py index 37e7515d465..f3c138b3aa8 100644 --- a/PIL/ImageStat.py +++ b/PIL/ImageStat.py @@ -26,7 +26,7 @@ import functools -class Stat: +class Stat(object): def __init__(self, image_or_list, mask=None): try: diff --git a/PIL/ImageTk.py b/PIL/ImageTk.py index 5fb5ecff392..68d388e7411 100644 --- a/PIL/ImageTk.py +++ b/PIL/ImageTk.py @@ -56,7 +56,7 @@ def _pilbitmap_check(): # -------------------------------------------------------------------- # PhotoImage -class PhotoImage: +class PhotoImage(object): """ A Tkinter-compatible photo image. This can be used everywhere Tkinter expects an image object. If the image is an RGBA @@ -190,7 +190,7 @@ def paste(self, im, box=None): # BitmapImage -class BitmapImage: +class BitmapImage(object): """ A Tkinter-compatible bitmap image. This can be used everywhere Tkinter diff --git a/PIL/ImageWin.py b/PIL/ImageWin.py index 300d118c932..bcb54bc3eaa 100644 --- a/PIL/ImageWin.py +++ b/PIL/ImageWin.py @@ -21,7 +21,7 @@ from PIL import Image -class HDC: +class HDC(object): """ Wraps an HDC integer. The resulting object can be passed to the :py:meth:`~PIL.ImageWin.Dib.draw` and :py:meth:`~PIL.ImageWin.Dib.expose` @@ -34,7 +34,7 @@ def __int__(self): return self.dc -class HWND: +class HWND(object): """ Wraps an HWND integer. The resulting object can be passed to the :py:meth:`~PIL.ImageWin.Dib.draw` and :py:meth:`~PIL.ImageWin.Dib.expose` @@ -47,7 +47,7 @@ def __int__(self): return self.wnd -class Dib: +class Dib(object): """ A Windows bitmap with the given mode and size. The mode can be one of "1", "L", "P", or "RGB". @@ -206,7 +206,7 @@ def tostring(self): ## # Create a Window with the given title size. -class Window: +class Window(object): def __init__(self, title="PIL", width=None, height=None): self.hwnd = Image.core.createwindow( diff --git a/PIL/IptcImagePlugin.py b/PIL/IptcImagePlugin.py index aa019389480..47c7e1936a2 100644 --- a/PIL/IptcImagePlugin.py +++ b/PIL/IptcImagePlugin.py @@ -251,7 +251,7 @@ def getiptcinfo(im): return None # no properties # create an IptcImagePlugin object without initializing it - class FakeImage: + class FakeImage(object): pass im = FakeImage() im.__class__ = IptcImageFile diff --git a/PIL/MpegImagePlugin.py b/PIL/MpegImagePlugin.py index 9aca58f16fb..ff7c0dce4c8 100644 --- a/PIL/MpegImagePlugin.py +++ b/PIL/MpegImagePlugin.py @@ -22,7 +22,7 @@ # # Bitstream parser -class BitStream: +class BitStream(object): def __init__(self, fp): self.fp = fp diff --git a/PIL/OleFileIO.py b/PIL/OleFileIO.py index c804dd454a9..d3c1cd9a090 100755 --- a/PIL/OleFileIO.py +++ b/PIL/OleFileIO.py @@ -473,7 +473,7 @@ def filetime2datetime(filetime): #=== CLASSES ================================================================== -class OleMetadata: +class OleMetadata(object): """ class to parse and store metadata from standard properties of OLE files. @@ -757,7 +757,7 @@ def __init__(self, fp, sect, size, offset, sectorsize, fat, filesize): #--- _OleDirectoryEntry ------------------------------------------------------- -class _OleDirectoryEntry: +class _OleDirectoryEntry(object): """ OLE2 Directory Entry @@ -1007,7 +1007,7 @@ def getctime(self): #--- OleFileIO ---------------------------------------------------------------- -class OleFileIO: +class OleFileIO(object): """ OLE container object diff --git a/PIL/PSDraw.py b/PIL/PSDraw.py index 6187e40adb6..66e3d79821b 100644 --- a/PIL/PSDraw.py +++ b/PIL/PSDraw.py @@ -23,7 +23,7 @@ ## # Simple Postscript graphics interface. -class PSDraw: +class PSDraw(object): """ Sets up printing to the given file. If **file** is omitted, :py:attr:`sys.stdout` is assumed. diff --git a/PIL/PaletteFile.py b/PIL/PaletteFile.py index 37ba4cbff89..ef50feefd2f 100644 --- a/PIL/PaletteFile.py +++ b/PIL/PaletteFile.py @@ -19,7 +19,7 @@ ## # File handler for Teragon-style palette files. -class PaletteFile: +class PaletteFile(object): rawmode = "RGB" diff --git a/PIL/PdfImagePlugin.py b/PIL/PdfImagePlugin.py index 5113f099e58..1d8c2ff9345 100644 --- a/PIL/PdfImagePlugin.py +++ b/PIL/PdfImagePlugin.py @@ -63,7 +63,7 @@ def _save(im, fp, filename): xref = [0]*(5+1) # placeholders - class TextWriter: + class TextWriter(object): def __init__(self, fp): self.fp = fp diff --git a/PIL/PngImagePlugin.py b/PIL/PngImagePlugin.py index 398a01f3322..53d38eecda0 100644 --- a/PIL/PngImagePlugin.py +++ b/PIL/PngImagePlugin.py @@ -90,7 +90,7 @@ def _safe_zlib_decompress(s): # -------------------------------------------------------------------- # Support classes. Suitable for PNG and related formats like MNG etc. -class ChunkStream: +class ChunkStream(object): def __init__(self, fp): @@ -183,7 +183,7 @@ def __new__(cls, text, lang, tkey): return self -class PngInfo: +class PngInfo(object): """ PNG chunk container (for use with save(pnginfo=)) @@ -620,7 +620,7 @@ def putchunk(fp, cid, *data): fp.write(o16(hi) + o16(lo)) -class _idat: +class _idat(object): # wrap output from the encoder in IDAT chunks def __init__(self, fp, chunk): @@ -771,7 +771,7 @@ def _save(im, fp, filename, chunk=putchunk, check=0): def getchunks(im, **params): """Return a list of PNG chunks representing this image.""" - class collector: + class collector(object): data = [] def write(self, data): diff --git a/PIL/WmfImagePlugin.py b/PIL/WmfImagePlugin.py index 6146c15604e..bdbbc72f03c 100644 --- a/PIL/WmfImagePlugin.py +++ b/PIL/WmfImagePlugin.py @@ -37,7 +37,7 @@ def register_handler(handler): if hasattr(Image.core, "drawwmf"): # install default handler (windows only) - class WmfHandler: + class WmfHandler(object): def open(self, im): im.mode = "RGB" diff --git a/Scripts/explode.py b/Scripts/explode.py index 0460fa02083..53436100bc5 100644 --- a/Scripts/explode.py +++ b/Scripts/explode.py @@ -13,7 +13,7 @@ import sys -class Interval: +class Interval(object): def __init__(self, interval="0"): diff --git a/Scripts/gifmaker.py b/Scripts/gifmaker.py index 8777f74f656..5d1781499d7 100644 --- a/Scripts/gifmaker.py +++ b/Scripts/gifmaker.py @@ -50,7 +50,7 @@ # sequence iterator -class image_sequence: +class image_sequence(object): def __init__(self, im): self.im = im diff --git a/Scripts/pildriver.py b/Scripts/pildriver.py index bb01004f5a7..32989ccdf38 100644 --- a/Scripts/pildriver.py +++ b/Scripts/pildriver.py @@ -53,7 +53,7 @@ from PIL import Image -class PILDriver: +class PILDriver(object): verbose = 0 diff --git a/Tests/test_file_iptc.py b/Tests/test_file_iptc.py index 14eb135aabe..84fa873be81 100644 --- a/Tests/test_file_iptc.py +++ b/Tests/test_file_iptc.py @@ -11,7 +11,7 @@ class TestFileIptc(PillowTestCase): def dummy_IptcImagePlugin(self): # Create an IptcImagePlugin object without initializing it - class FakeImage: + class FakeImage(object): pass im = FakeImage() im.__class__ = IptcImagePlugin.IptcImageFile diff --git a/Tests/test_imagefileio.py b/Tests/test_imagefileio.py index f1847440331..b0617843708 100644 --- a/Tests/test_imagefileio.py +++ b/Tests/test_imagefileio.py @@ -8,7 +8,7 @@ class TestImageFileIo(PillowTestCase): def test_fileio(self): - class DumbFile: + class DumbFile(object): def __init__(self, data): self.data = data diff --git a/Tests/test_imagefont.py b/Tests/test_imagefont.py index 49aa9c8b26d..88858c71720 100644 --- a/Tests/test_imagefont.py +++ b/Tests/test_imagefont.py @@ -15,7 +15,7 @@ from PIL import ImageFont ImageFont.core.getfont # check if freetype is available - class SimplePatcher(): + class SimplePatcher(object): def __init__(self, parent_obj, attr_name, value): self._parent_obj = parent_obj self._attr_name = attr_name diff --git a/Tests/test_imageops.py b/Tests/test_imageops.py index 0ffb14bfebc..396f0da6cbd 100644 --- a/Tests/test_imageops.py +++ b/Tests/test_imageops.py @@ -5,7 +5,7 @@ class TestImageOps(PillowTestCase): - class Deformer: + class Deformer(object): def getmesh(self, im): x, y = im.size return [((0, 0, x, y), (0, 0, x, 0, x, y, y, 0))]