Skip to content
Snippets Groups Projects
Commit 49296ae4 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Review modifier.py documentation.

parent d55d8a6d
No related branches found
No related tags found
No related merge requests found
plugin_dbui.modifier.Modifier.configure
=======================================
.. currentmodule:: plugin_dbui.modifier
.. automethod:: Modifier.configure
\ No newline at end of file
plugin_dbui.modifier.Modifier
=============================
.. currentmodule:: plugin_dbui.modifier
.. autoclass:: Modifier
.. rubric:: Methods
.. autosummary::
:toctree: modifier/
~Modifier.configure
......@@ -12,37 +12,38 @@ MSG_INVALID_TYPE = "Invalid plugin type"
class Modifier(object):
"""Base class to construct Modifier tools.
Attributes:
data (gluon.storage.Storage):
Args:
dpname (str): name of the data point.
tablename (str):name of the database table.
"""
Notes:
* A modifier stores its instructions in a global buffer
handles by the web2py ``PluginManager``.
def __init__(self, dpname, tablename=None):
"""Create the ``gluon.storage.Storage`` in the plugin dbui to house
modifier information.
* The instructions are kept in a ``gluon.storage.Storage``.
Its path is defined by the ``dpname`` and ``tablename`` arguments.
* The path to access to the Storage is defined by the ``dpname``
and ``tablename``.
* The ``Storage`` is linked to the class attribute ``data``.
* The ``Storage`` can be accessed outside the modifier
in the following way::
* The storage can be accessed from anywhere::
p = PluginManager('dbui')
modifier = p.dbui[dpname]
p = PluginManager('dbui')
modifier = p.dbui[dpname]
or when the tablename is defined::
or when the ``tablename`` is defined::
p = PluginManager('dbui')
modifier = p.dbui[dpname][tablename]
p = PluginManager('dbui')
modifier = p.dbui[dpname][tablename]
* The ``Storage`` contains the ``extjs`` key to store
configuration parameter of the associate Ext JS widget.
Attributes:
data (gluon.storage.Storage): contains all the instructions.
It has one key/attribute:
Args:
dpname (str): name of the data point.
tablename (str):name of the database table.
* **extjs** to store configuration options
of the associate Ext JS widget.
"""
def __init__(self, dpname, tablename=None):
"""
p = PluginManager('dbui')
if tablename:
......@@ -64,7 +65,10 @@ class Modifier(object):
def configure(self, **extjs):
"""Set the configuration parameters for the associated Ext JS widget.
.. note::
Keyword Args:
**extjs: any configuration options of the associated Ext JS widget.
Notes:
* Existing value of the configuration parameters are replaced by
those defined in the keyword arguments.
......@@ -75,9 +79,9 @@ class Modifier(object):
If a plugin with the same ptype alsready exists in the list
it is replaced by the new definition.
* A plugin is defined by a string containing is ``pType``.
* A plugin can be defined by a string containing is ``pType``.
* A plugin is defined by a dictionary containing the ``pType``
* A plugin can be defined by a dictionary containing the ``pType``
and the plugin configuration options::
{'ptype': foo, 'option1': val,...}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment