Commit 2e90628b authored by Etienne Nadji's avatar Etienne Nadji
Browse files

docstrings

	modifié :         source/pyscribus/colors.py
	modifié :         source/pyscribus/pageobjects.py
parent 551e4ddc
......@@ -227,6 +227,28 @@ class Color(xmlc.PyScribusElement):
#--- PyScribus standard methods ----------------------------
def fromdefault(self, default: str = "Black"):
"""
Set default attributes for this color.
:Example:
.. code:: python
# with fromdefault method :
black = Color()
black.fromdefault("Black")
# with quick setup :
blue = Color(default="Blue")
.. seealso::
**For fromdefault explanation**:
`pyscribus.common.xml.PyScribusElement.fromdefault`
**For current class default sets**:
`pyscribus.colors.Color.listdefaults`
"""
if default in self.pyscribus_defaults:
......
......@@ -62,10 +62,11 @@ po_type_xml = {
class PageObject(xmlc.PyScribusElement):
"""
Page object in SLA (PAGEOBJECT)
Page object in SLA (``/DOCUMENT/PAGEOBJECT``)
You should rather use TableObject, TextObject, TextOnPathObject,
ImageObject, LineObject, PolylineObject, PolygonObject, RenderObject.
You should rather use :class:`TableObject`, :class:`TextObject`,
:class:`TextOnPathObject`, :class:`ImageObject`, :class:`LineObject`,
:class:`PolylineObject`, :class:`PolygonObject`, :class:`RenderObject`.
:param ptype: Type of the PageObject. Must be in pageobjects.po_type_xml
keys.
......@@ -2053,17 +2054,17 @@ class RenderObject(PageObject):
:rtype: boolean
:returns: True if package appending succeed
.. note:: As LaTeX additional headers is managed with
pageobjects.HeadersRenderProperty, it is better to use this method
than editing RenderBuffer.properties.
:Example:
Example:
.. code:: python
render_buffer.append_package("csquotes", "strict=true")
# equivalent to: \\usepackage[strict=true]{csquotes}
render_buffer.append_package("csquotes", "strict=true")
is the equivalent of :
.. note:: As LaTeX additional headers is managed with
:class:`HeadersRenderProperty`, it is better to use this method
than editing ``RenderBuffer.properties``.
\\usepackage[strict=true]{csquotes}
"""
if self.buffer is not None:
......@@ -2077,7 +2078,7 @@ class RenderObject(PageObject):
:param fontsize: Font size in points
.. note:: As fontsize is a standard render frame property, it is better
to use this method than editing RenderBuffer.properties.
to use this method than editing ``RenderBuffer.properties``.
"""
if self.buffer is not None:
......@@ -2577,6 +2578,11 @@ class TableCell(xmlc.PyScribusElement):
class RenderBuffer(xmlc.PyScribusElement):
"""
Object for render frame's (RenderObject) content.
:ivar list properties: List of properties
:ivar string content: Content of the buffer
.. seealso:: :class:`RenderProperty`, :class:`HeadersRenderProperty`
"""
def __init__(self):
......@@ -2641,17 +2647,18 @@ class RenderBuffer(xmlc.PyScribusElement):
:rtype: boolean
:returns: True if package appending succeed
.. note:: As LaTeX additional headers is managed with
pageobjects.HeadersRenderProperty, it is better to use this method
than editing RenderBuffer.properties.
:Example:
.. code:: python
Example:
# equivalent to: \\usepackage[strict=true]{csquotes}
render_buffer.append_package("csquotes", "strict=true")
render_buffer.append_package("csquotes", "strict=true")
.. note:: As LaTeX additional headers is managed with
:class:`HeadersRenderProperty`, it is better to use this method
than editing ``RenderBuffer.properties``.
is the equivalent of :
\\usepackage[strict=true]{csquotes}
"""
for prop in properties:
......@@ -2671,7 +2678,7 @@ class RenderBuffer(xmlc.PyScribusElement):
:param fontsize: Font size in points
.. note:: As fontsize is a standard render frame property, it is better
to use this method than editing RenderBuffer.properties.
to use this method than editing ``RenderBuffer.properties``.
"""
for prop in self.properties:
......@@ -2817,7 +2824,8 @@ class HeadersRenderProperty(RenderProperty):
:type value: str
:param value: Value of the property
.. note:: HeadersRenderProperty property name is always additionalheaders.
.. note:: :class:`HeadersRenderProperty` property name is always
``additionalheaders``.
.. seealso:: :class:`RenderProperty`
"""
......@@ -2934,9 +2942,9 @@ class RectPath:
Translate SVG path @d strings like :
M0 0 L515.276 0 L515.276 761.89 L0 761.89 L0 0 Z
``M0 0 L515.276 0 L515.276 761.89 L0 761.89 L0 0 Z``
Into a list of PathPoint instances.
Into a list of :class:`PathPoint` instances.
"""
def __init__(self):
......
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