Rewritten epytext strings in qidenticon and removed __all__
This commit is contained in:
parent
53cc08edec
commit
9e72e3b2af
|
@ -1,23 +1,19 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
# -*- coding:utf-8 -*-
|
|
||||||
# pylint: disable=too-many-locals,too-many-arguments,too-many-function-args
|
# pylint: disable=too-many-locals,too-many-arguments,too-many-function-args
|
||||||
"""
|
"""
|
||||||
= usage =
|
Usage
|
||||||
|
-----
|
||||||
|
|
||||||
== python ==
|
|
||||||
>>> import qtidenticon
|
>>> import qtidenticon
|
||||||
>>> qtidenticon.render_identicon(code, size)
|
>>> qtidenticon.render_identicon(code, size)
|
||||||
|
|
||||||
Return a PIL Image class instance which have generated identicon image.
|
Return a PIL Image class instance 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``.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
from PyQt4.QtCore import QSize, QPointF, Qt
|
from PyQt4.QtCore import QSize, QPointF, Qt
|
||||||
from PyQt4.QtGui import QPixmap, QPainter, QPolygonF
|
from PyQt4.QtGui import QPixmap, QPainter, QPolygonF
|
||||||
|
|
||||||
__all__ = ['render_identicon', 'IdenticonRendererBase']
|
|
||||||
|
|
||||||
|
|
||||||
class IdenticonRendererBase(object):
|
class IdenticonRendererBase(object):
|
||||||
"""Encapsulate methods around rendering identicons"""
|
"""Encapsulate methods around rendering identicons"""
|
||||||
|
@ -26,7 +22,7 @@ class IdenticonRendererBase(object):
|
||||||
|
|
||||||
def __init__(self, code):
|
def __init__(self, code):
|
||||||
"""
|
"""
|
||||||
@param code code for icon
|
:param code: code for icon
|
||||||
"""
|
"""
|
||||||
if not isinstance(code, int):
|
if not isinstance(code, int):
|
||||||
code = int(code)
|
code = int(code)
|
||||||
|
@ -36,8 +32,8 @@ class IdenticonRendererBase(object):
|
||||||
"""
|
"""
|
||||||
render identicon to QPicture
|
render identicon to QPicture
|
||||||
|
|
||||||
@param size identicon patchsize. (image size is 3 * [size])
|
:param size: identicon patchsize. (image size is 3 * [size])
|
||||||
@return QPicture
|
:returns: :class:`QPicture`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# decode the code
|
# decode the code
|
||||||
|
@ -79,7 +75,7 @@ class IdenticonRendererBase(object):
|
||||||
def drawPatchQt(self, pos, turn, invert, patch_type, image, size, foreColor,
|
def drawPatchQt(self, pos, turn, invert, patch_type, image, size, foreColor,
|
||||||
backColor, penwidth): # pylint: disable=unused-argument
|
backColor, penwidth): # pylint: disable=unused-argument
|
||||||
"""
|
"""
|
||||||
@param size patch size
|
:param size: patch size
|
||||||
"""
|
"""
|
||||||
path = self.PATH_SET[patch_type]
|
path = self.PATH_SET[patch_type]
|
||||||
if not path:
|
if not path:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user