Rewritten epytext strings in qidenticon and removed __all__

This commit is contained in:
Dmitri Bogomolov 2019-10-11 14:14:08 +03:00
parent 53cc08edec
commit 9e72e3b2af
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -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:
@ -134,7 +130,7 @@ class IdenticonRendererBase(object):
class DonRenderer(IdenticonRendererBase): class DonRenderer(IdenticonRendererBase):
""" """
Don Park's implementation of identicon Don Park's implementation of identicon
see : http://www.docuverse.com/blog/donpark/2007/01/19/identicon-updated-and-source-released see: http://www.docuverse.com/blog/donpark/2007/01/19/identicon-updated-and-source-released
""" """
PATH_SET = [ PATH_SET = [