mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Flake8 and health fixes
This commit is contained in:
parent
43e2c92802
commit
33d51d4255
|
@ -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)
|
||||
return QPixmap.fromImage(qimage)
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user