Updated code quality replaced xrange by six.moves.range function changes in qidenticon.py
Removed xrange ignore comments & replaced xrange by six.moves.range function
This commit is contained in:
parent
a7d6037fc5
commit
cc3ff3bb2d
|
@ -40,6 +40,7 @@ Returns an instance of :class:`QPixmap` which have generated identicon image.
|
||||||
``size`` specifies `patch size`. Generated image size is 3 * ``size``.
|
``size`` specifies `patch size`. Generated image size is 3 * ``size``.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import six.moves
|
||||||
try:
|
try:
|
||||||
from PyQt5 import QtCore, QtGui
|
from PyQt5 import QtCore, QtGui
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -93,14 +94,14 @@ class IdenticonRendererBase(object):
|
||||||
# side patch
|
# side patch
|
||||||
kwds['foreColor'] = foreColor
|
kwds['foreColor'] = foreColor
|
||||||
kwds['patch_type'] = side[0]
|
kwds['patch_type'] = side[0]
|
||||||
for i in range(4):
|
for i in six.moves.range(4):
|
||||||
pos = [(1, 0), (2, 1), (1, 2), (0, 1)][i]
|
pos = [(1, 0), (2, 1), (1, 2), (0, 1)][i]
|
||||||
image = self.drawPatchQt(pos, side[2] + 1 + i, side[1], **kwds)
|
image = self.drawPatchQt(pos, side[2] + 1 + i, side[1], **kwds)
|
||||||
|
|
||||||
# corner patch
|
# corner patch
|
||||||
kwds['foreColor'] = secondColor
|
kwds['foreColor'] = secondColor
|
||||||
kwds['patch_type'] = corner[0]
|
kwds['patch_type'] = corner[0]
|
||||||
for i in range(4):
|
for i in six.moves.range(4):
|
||||||
pos = [(0, 0), (2, 0), (2, 2), (0, 2)][i]
|
pos = [(0, 0), (2, 0), (2, 2), (0, 2)][i]
|
||||||
image = self.drawPatchQt(pos, corner[2] + 1 + i, corner[1], **kwds)
|
image = self.drawPatchQt(pos, corner[2] + 1 + i, corner[1], **kwds)
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user