Commit 551e4ddc authored by Etienne Nadji's avatar Etienne Nadji
Browse files

docstrings

	modifié :         colors.py
	modifié :         pageobjects.py
	modifié :         pages.py
parent b44cd6c7
......@@ -40,6 +40,19 @@ __author__ = "Etienne Nadji <etnadji@eml.cc>"
class Color(xmlc.PyScribusElement):
"""
SLA Color (COLOR)
:type kwargs: dict
:param kwargs: Quick setting (see kwargs table)
+------------+---------------------------------+-----------+
| Kwargs | Setting | Type |
+============+=================================+===========+
| default | Equivalent to a ``fromdefault`` | boolean |
| | call. | or string |
| | | |
| | Value being True or the name of | |
| | the default set. | |
+------------+---------------------------------+-----------+
"""
defaults = {
......@@ -96,7 +109,7 @@ class Color(xmlc.PyScribusElement):
def __init__(
self, name="Black", space="CMYK", colors=[0,0,0,100],
register="0"):
register="0", **kwargs):
super().__init__()
self.pyscribus_defaults = [k for k in Color.defaults.keys()]
......@@ -105,6 +118,8 @@ class Color(xmlc.PyScribusElement):
self.register = register
self.set_space_colors(space, colors)
self._quick_setup(kwargs)
#--- Color management --------------------------------------
def set_space_colors(self, space: str, colors: list):
......@@ -312,6 +327,21 @@ class Color(xmlc.PyScribusElement):
return xml
def _quick_setup(self, settings: dict):
"""
Method for defining gradient stop settings from class
instanciation kwargs.
:type settings: dict
:param settings: Kwargs dictionnary
"""
if settings:
xmlc.PyScribusElement._quick_setup(self, settings)
for setting_name, setting_value in settings.items():
pass
#--- Python __ methods -------------------------------------
def __eq__(self, other):
......@@ -376,21 +406,24 @@ class GradientColorStop(xmlc.PyScribusElement):
:type kwargs: dict
:param kwargs: Quick setting (see kwargs table)
+------------+-------------------------------+-----------+
| Kwargs | Setting | Type |
+============+===============================+===========+
| default | Equivalent to a fromdefault | boolean |
| | call, value being True or the | or string |
| | default name | |
+------------+-------------------------------+-----------+
| position | | |
+------------+-------------------------------+-----------+
| color | | |
+------------+-------------------------------+-----------+
| shade | | |
+------------+-------------------------------+-----------+
| opacity | | |
+------------+-------------------------------+-----------+
+------------+---------------------------------+-----------+
| Kwargs | Setting | Type |
+============+=================================+===========+
| default | Equivalent to a ``fromdefault`` | boolean |
| | call. | or string |
| | | |
| | Value being True or the name of | |
| | the default set. | |
+------------+---------------------------------+-----------+
| opacity | Percentage of opacity, | float |
| | from 0 to 1. | |
+------------+---------------------------------+-----------+
| color | Color name | string |
+------------+---------------------------------+-----------+
| position | | |
+------------+---------------------------------+-----------+
| shade | | |
+------------+---------------------------------+-----------+
:Example:
......
......@@ -1549,17 +1549,28 @@ class TextObject(PageObject):
:type kwargs: dict
:param kwargs: Quick setting (see kwargs table)
+------------+-------------------------------+-----------+
| Kwargs | Setting | Type |
+============+===============================+===========+
| default | Equivalent to a fromdefault | boolean |
| | call, value being True or the | or string |
| | default name | |
+------------+-------------------------------+-----------+
| columns | Column count | integer |
+------------+-------------------------------+-----------+
| columnsgap | Gap between each column | float |
+------------+-------------------------------+-----------+
:ivar string vertical_alignment: Vertical alignement of the text.
:ivar dict padding: Padding(s) of the text frame.
+------------+---------------------------------+-----------+
| Kwargs | Setting | Type |
+============+=================================+===========+
| default | Equivalent to a ``fromdefault`` | boolean |
| | call. | or string |
| | | |
| | Value being True or the name of | |
| | the default set. | |
+------------+---------------------------------+-----------+
| columns | Column count | integer |
+------------+---------------------------------+-----------+
| columnsgap | Gap between each column | float |
+------------+---------------------------------+-----------+
| valign | Vertical alignement of the | string |
| | text. | |
| | | |
| | Must be "top", "center", | |
| | "center". | |
+------------+---------------------------------+-----------+
"""
vertical_alignment_xml = {
......@@ -1821,18 +1832,21 @@ class ImageObject(PageObject):
:type kwargs: dict
:param kwargs: Quick setting (see kwargs table)
+----------+-------------------------------+---------------+
| Kwargs | Setting | Type |
+==========+===============================+===============+
| default | Equivalent to a fromdefault | boolean |
| | call, value being True or the | or string |
| | default name | |
+----------+-------------------------------+---------------+
| filepath | Image filepath | string |
+----------+-------------------------------+---------------+
| filedata | Image data | Qt compressed |
| | | base64 string |
+----------+-------------------------------+---------------+
+------------+---------------------------------+---------------+
| Kwargs | Setting | Type |
+============+=================================+===============+
| default | Equivalent to a ``fromdefault`` | boolean |
| | call. | or string |
| | | |
| | Value being True or the name of | |
| | the default set. | |
+------------+---------------------------------+---------------+
| filepath | Image filepath | string |
+------------+---------------------------------+---------------+
| filedata | Image data | Qt compressed |
| | | |
| | | base64 string |
+------------+---------------------------------+---------------+
:ivar string filepath: File path of the image
:ivar string data: Data if the incorporated image
......@@ -2104,97 +2118,103 @@ class TableCell(xmlc.PyScribusElement):
:ivar integer column: Cell column
:ivar string align: Cell vertical alignment
+---------------+--------------------------------+-----------+
| Kwargs | Setting | Type |
+===============+================================+===========+
| default | Equivalent to a fromdefault | boolean |
| | call, value being True or the | or string |
| | default name | |
+---------------+--------------------------------+-----------+
| row | Row number (ranging from 0) | integer |
+---------------+--------------------------------+-----------+
| column | Column number (ranging from 0) | integer |
+---------------+--------------------------------+-----------+
| posx | X position of the page | float |
+---------------+--------------------------------+-----------+
| posy | Y position of the page | float |
+---------------+--------------------------------+-----------+
| width | Page width | float |
+---------------+--------------------------------+-----------+
| height | Page height | float |
+---------------+--------------------------------+-----------+
| style | Cell story paragraph style | string |
| | name | |
+---------------+--------------------------------+-----------+
| fillcolor | Filling color name | string |
+---------------+--------------------------------+-----------+
| fillshade | Filling color shade | float |
| | percentage | |
+---------------+--------------------------------+-----------+
| alignment | | |
+---------------+--------------------------------+-----------+
| borders | Shorthand for rightborder, | List of |
| | leftborder, topborder, | floats |
| | bottomborder. | |
| | | |
| | Read like the CSS margin | |
| | property: | |
| | | |
| | **With 1 float in the list :** | |
| | | |
| | [top & right & bottom & left] | |
| | | |
| | **With 2 float in the list :** | |
| | | |
| | [top & bottom, right & left] | |
| | | |
| | **With 3 float in the list :** | |
| | | |
| | [top, right & left, bottom] | |
| | | |
| | **With 4 float in the list :** | |
| | | |
| | [top, right, bottom, left] | |
+---------------+--------------------------------+-----------+
| rightborder | | float |
+---------------+--------------------------------+-----------+
| leftborder | | float |
+---------------+--------------------------------+-----------+
| topborder | | float |
+---------------+--------------------------------+-----------+
| bottomborder | | float |
+---------------+--------------------------------+-----------+
| padding | Shorthand for rightpadding, | List of |
| | leftpadding, toppadding, | floats |
| | bottompadding. | |
| | | |
| | Read like the CSS margin | |
| | property: | |
| | | |
| | **With 1 float in the list :** | |
| | | |
| | [top & right & bottom & left] | |
| | | |
| | **With 2 float in the list :** | |
| | | |
| | [top & bottom, right & left] | |
| | | |
| | **With 3 float in the list :** | |
| | | |
| | [top, right & left, bottom] | |
| | | |
| | **With 4 float in the list :** | |
| | | |
| | [top, right, bottom, left] | |
+---------------+--------------------------------+-----------+
| rightpadding | | float |
+---------------+--------------------------------+-----------+
| leftpadding | | float |
+---------------+--------------------------------+-----------+
| toppadding | | float |
+---------------+--------------------------------+-----------+
| bottompadding | | float |
+---------------+--------------------------------+-----------+
+---------------+---------------------------------+-----------+
| Kwargs | Setting | Type |
+===============+=================================+===========+
| default | Equivalent to a ``fromdefault`` | boolean |
| | call. | or string |
| | | |
| | Value being True or the name of | |
| | the default set. | |
+---------------+---------------------------------+-----------+
| row | Row number (ranging from 0) | integer |
+---------------+---------------------------------+-----------+
| column | Column number (ranging from 0) | integer |
+---------------+---------------------------------+-----------+
| posx | X position of the page | float |
+---------------+---------------------------------+-----------+
| posy | Y position of the page | float |
+---------------+---------------------------------+-----------+
| width | Page width | float |
+---------------+---------------------------------+-----------+
| height | Page height | float |
+---------------+---------------------------------+-----------+
| style | Cell story paragraph style | string |
| | name | |
+---------------+---------------------------------+-----------+
| fillcolor | Filling color name | string |
+---------------+---------------------------------+-----------+
| fillshade | Filling color shade | float |
| | percentage | |
+---------------+---------------------------------+-----------+
| alignment | | |
+---------------+---------------------------------+-----------+
| borders | Shorthand for : | List of |
| | | floats |
| | *rightborder*, *leftborder*, | |
| | | |
| | *topborder*, *bottomborder* | |
| | | |
| | Read like the CSS margin | |
| | property: | |
| | | |
| | **With 1 float in the list :** | |
| | | |
| | [top & right & bottom & left] | |
| | | |
| | **With 2 float in the list :** | |
| | | |
| | [top & bottom, right & left] | |
| | | |
| | **With 3 float in the list :** | |
| | | |
| | [top, right & left, bottom] | |
| | | |
| | **With 4 float in the list :** | |
| | | |
| | [top, right, bottom, left] | |
+---------------+---------------------------------+-----------+
| rightborder | | float |
+---------------+---------------------------------+-----------+
| leftborder | | float |
+---------------+---------------------------------+-----------+
| topborder | | float |
+---------------+---------------------------------+-----------+
| bottomborder | | float |
+---------------+---------------------------------+-----------+
| padding | Shorthand for : | List of |
| | | floats |
| | *rightpadding*, *leftpadding*, | |
| | | |
| | *toppadding*, *bottompadding*. | |
| | | |
| | Read like the CSS margin | |
| | property: | |
| | | |
| | **With 1 float in the list :** | |
| | | |
| | [top & right & bottom & left] | |
| | | |
| | **With 2 float in the list :** | |
| | | |
| | [top & bottom, right & left] | |
| | | |
| | **With 3 float in the list :** | |
| | | |
| | [top, right & left, bottom] | |
| | | |
| | **With 4 float in the list :** | |
| | | |
| | [top, right, bottom, left] | |
+---------------+---------------------------------+-----------+
| rightpadding | | float |
+---------------+---------------------------------+-----------+
| leftpadding | | float |
+---------------+---------------------------------+-----------+
| toppadding | | float |
+---------------+---------------------------------+-----------+
| bottompadding | | float |
+---------------+---------------------------------+-----------+
"""
# TextColumns="1"
......
......@@ -585,52 +585,55 @@ class Page(PageAbstract):
:type kwargs: dict
:param kwargs: Quick setting (see kwargs table)
+--------------+--------------------------------+------------+
| Kwargs | Setting | Value type |
+==============+================================+============+
| default | Equivalent to a fromdefault | boolean or |
| | call, value being the default | string |
| | name or True | |
+--------------+--------------------------------+------------+
| posx | X position of the page | float |
+--------------+--------------------------------+------------+
| posy | Y position of the page | float |
+--------------+--------------------------------+------------+
| width | Page width | float |
+--------------+--------------------------------+------------+
| height | Page height | float |
+--------------+--------------------------------+------------+
| borders | Shorthand for rightborder, | List of |
| | leftborder, topborder, | floats |
| | bottomborder. | |
| | | |
| | Read like the CSS margin | |
| | property: | |
| | | |
| | **With 1 float in the list :** | |
| | | |
| | [top & right & bottom & left] | |
| | | |
| | **With 2 float in the list :** | |
| | | |
| | [top & bottom, right & left] | |
| | | |
| | **With 3 float in the list :** | |
| | | |
| | [top, right & left, bottom] | |
| | | |
| | **With 4 float in the list :** | |
| | | |
| | [top, right, bottom, left] | |
+--------------+--------------------------------+------------+
| rightborder | | float |
+--------------+--------------------------------+------------+
| leftborder | | float |
+--------------+--------------------------------+------------+
| topborder | | float |
+--------------+--------------------------------+------------+
| bottomborder | | float |
+--------------+--------------------------------+------------+
+--------------+---------------------------------+------------+
| Kwargs | Setting | Value type |
+==============+=================================+============+
| default | Equivalent to a ``fromdefault`` | boolean |
| | call. | or string |
| | | |
| | Value being True or the name of | |
| | the default set. | |
+--------------+---------------------------------+------------+
| posx | X position of the page | float |
+--------------+---------------------------------+------------+
| posy | Y position of the page | float |
+--------------+---------------------------------+------------+
| width | Page width | float |
+--------------+---------------------------------+------------+
| height | Page height | float |
+--------------+---------------------------------+------------+
| borders | Shorthand for : | List of |
| | | floats |
| | *rightborder*, *leftborder*, | |
| | *topborder*, *bottomborder* | |
| | | |
| | Read like the CSS margin | |
| | property: | |
| | | |
| | **With 1 float in the list :** | |
| | | |
| | [top & right & bottom & left] | |
| | | |
| | **With 2 float in the list :** | |
| | | |
| | [top & bottom, right & left] | |
| | | |
| | **With 3 float in the list :** | |
| | | |
| | [top, right & left, bottom] | |
| | | |
| | **With 4 float in the list :** | |
| | | |
| | [top, right, bottom, left] | |
+--------------+---------------------------------+------------+
| rightborder | Right border | float |
+--------------+---------------------------------+------------+
| leftborder | Left border | float |
+--------------+---------------------------------+------------+
| topborder | Top border | float |
+--------------+---------------------------------+------------+
| bottomborder | Bottom border | float |
+--------------+---------------------------------+------------+
"""
def __init__(self, **kwargs):
......@@ -687,52 +690,55 @@ class MasterPage(PageAbstract):
:type kwargs: dict
:param kwargs: Quick setting (see kwargs table)
+--------------+--------------------------------+------------+
| Kwargs | Setting | Value type |
+==============+================================+============+
| default | Equivalent to a fromdefault | boolean or |
| | call, value being the default | string |
| | name or True | |
+--------------+--------------------------------+------------+
| posx | X position of the page | float |
+--------------+--------------------------------+------------+
| posy | Y position of the page | float |
+--------------+--------------------------------+------------+
| width | Page width | float |
+--------------+--------------------------------+------------+
| height | Page height | float |
+--------------+--------------------------------+------------+
| borders | Shorthand for rightborder, | List of |
| | leftborder, topborder, | floats |
| | bottomborder. | |
| | | |
| | Read like the CSS margin | |
| | property: | |
| | | |
| | **With 1 float in the list :** | |
| | | |
| | [top & right & bottom & left] | |
| | | |
| | **With 2 float in the list :** | |
| | | |
| | [top & bottom, right & left] | |
| | | |
| | **With 3 float in the list :** | |
| | | |
| | [top, right & left, bottom] | |
| | | |
| | **With 4 float in the list :** | |
| | | |
| | [top, right, bottom, left] | |
+--------------+--------------------------------+------------+
| rightborder | | float |
+--------------+--------------------------------+------------+
| leftborder | | float |
+--------------+--------------------------------+------------+
| topborder | | float |
+--------------+--------------------------------+------------+
| bottomborder | | float |
+--------------+--------------------------------+------------+
+--------------+---------------------------------+------------+
| Kwargs | Setting | Value type |
+==============+=================================+============+
| default | Equivalent to a ``fromdefault`` | boolean |
| | call. | or string |
| | | |
| | Value being True or the name of | |
| | the default set. | |
+--------------+---------------------------------+------------+
| posx | X position of the page | float |
+--------------+---------------------------------+------------+
| posy | Y position of the page | float |
+--------------+---------------------------------+------------+
| width | Page width | float |
+--------------+---------------------------------+------------+
| height | Page height | float |
+--------------+---------------------------------+------------+
| borders | Shorthand for : | List of |
| | | floats |
| | *rightborder*, *leftborder*, | |
| | *topborder*, *bottomborder* | |
| | | |
| | Read like the CSS margin | |
| | property: | |
| | | |
| | **With 1 float in the list :** | |
| | | |
| | [top & right & bottom & left] | |
| | | |
| | **With 2 float in the list :** | |
| | | |
| | [top & bottom, right & left] | |
| | | |
| | **With 3 float in the list :** | |
| | | |
| | [top, right & left, bottom] | |
| | | |
| | **With 4 float in the list :** | |
| | | |
| | [top, right, bottom, left] | |
+--------------+---------------------------------+------------+
| rightborder | Right border | float |
+--------------+---------------------------------+------------+
| leftborder | Left border | float |
+--------------+---------------------------------+------------+
| topborder | Top border | float |
+--------------+---------------------------------+------------+
| bottomborder | Bottom border | float |
+--------------+---------------------------------+------------+
"""
def __init__(self, **kwargs):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment