From 33d51d4255593c825454981bc934a5cf51d79c70 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 19 Jun 2015 15:36:23 +1000 Subject: [PATCH] Flake8 and health fixes --- PIL/ImageQt.py | 10 +++++----- Tests/test_imageqt.py | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/PIL/ImageQt.py b/PIL/ImageQt.py index 95819029d..52dd7d79f 100644 --- a/PIL/ImageQt.py +++ b/PIL/ImageQt.py @@ -48,7 +48,8 @@ def rgb(r, g, b, a=255): return (qRgba(r, g, b, a) & 0xffffffff) -# :param im A PIL Image object, or a file name (given either as Python string or a PyQt string object). +# :param im A PIL Image object, or a file name +# (given either as Python string or a PyQt string object) def fromqimage(im): buffer = QBuffer() @@ -139,9 +140,8 @@ if qt_is_installed: def __init__(self, im): im_data = _toqclass_helper(im) QImage.__init__(self, - im_data['data'], im_data['im'].size[0], im_data['im'].size[1], - im_data['format'] - ) + im_data['data'], im_data['im'].size[0], + im_data['im'].size[1], im_data['format']) if im_data['colortable']: self.setColorTable(im_data['colortable']) @@ -160,4 +160,4 @@ def toqpixmap(im): im = im.convert('RGBA') qimage = toqimage(im) qimage.save('/tmp/hopper_{}_qpixmap_qimage.png'.format(im.mode)) - return QPixmap.fromImage(qimage) \ No newline at end of file + return QPixmap.fromImage(qimage) diff --git a/Tests/test_imageqt.py b/Tests/test_imageqt.py index 5959bee34..b17d27e71 100644 --- a/Tests/test_imageqt.py +++ b/Tests/test_imageqt.py @@ -13,7 +13,7 @@ else: test_case.skipTest('PyQt4, PyQt5, or PySide is not installed') -class PillowQtTestCase: +class PillowQtTestCase(object): def setUp(self): skip_if_qt_is_not_installed(self) @@ -21,6 +21,7 @@ class PillowQtTestCase: def tearDown(self): pass + class PillowQPixmapTestCase(PillowQtTestCase): def setUp(self): @@ -34,7 +35,7 @@ class PillowQPixmapTestCase(PillowQtTestCase): from PySide.QtGui import QGuiApplication except ImportError: self.skipTest('QGuiApplication not installed') - + self.app = QGuiApplication([]) def tearDown(self):