Commit fa67b938 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Sphinx documentation for the list_postprocessing module.

parent 6b8eb14e
list_postprocessing.clean
=========================
.. currentmodule:: list_postprocessing
.. autofunction:: clean
\ No newline at end of file
list_postprocessing.highlight_my_authors
========================================
.. currentmodule:: list_postprocessing
.. autofunction:: highlight_my_authors
\ No newline at end of file
list_postprocessing.highlight_my_speaker
========================================
.. currentmodule:: list_postprocessing
.. autofunction:: highlight_my_speaker
\ No newline at end of file
list_postprocessing.remove_undef
================================
.. currentmodule:: list_postprocessing
.. autofunction:: remove_undef
\ No newline at end of file
......@@ -54,3 +54,20 @@ insertion / update in the database.
~CLEAN_COLLABORATION
~CLEAN_REVIEW
~CLEAN_THESIS_DEFENSE
post-processing to polish a list of publications
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A collection of functions to polish the representation of a
publication in a list.
.. currentmodule:: list_postprocessing
.. autosummary::
:toctree: generated/
~clean
~highlight_my_authors
~highlight_my_speaker
~remove_undef
# -*- coding: utf-8 -*-
"""a collection of functions to polish the representation of a
"""A collection of functions to polish the representation of a
publication in a list.
@author: R. Le Gac
"""
import plugin_dbui
import re
......@@ -14,22 +12,19 @@ from gluon import current
def clean(value, template, record):
"""Clean the representation of the record by removing typography mistakes.
@type value: unicode
@param value: the current string representing the record
Args:
value (unicode): the current string representing the record.
@type template: unicode
@param template:
- The template string to be applied to the record in order
to obtain a new representation.
- The substitution mechanism is: C{"{tablename.fieldname}"} or
C{"{referencetablename.fieldname}"}.
template (unicode): the template string to be applied to the value
in order to obtain a new representation. The substitution
mechanism is: ``"{tablename.fieldname}"`` or
``"{referencetablename.fieldname}"``.
@type record: gluon.dal.Row
@param record: the database row to be manipulated
- Contain the table C{publications} and all reference tables.
record (gluon.dal.Row): the database row to be manipulated.
It contains the table *publications* and all foreign tables.
@rtype: unicode
@return:
Returns:
unicode:
"""
value = re.sub(', *,', ',', value) # ",," or ", ," or ...
......@@ -41,22 +36,19 @@ def clean(value, template, record):
def highlight_my_authors(value, template, record):
"""Highlight the name of the authors of my institute by underlying them.
@type value: unicode
@param value: the current string representing the record
Args:
value (unicode): the current string representing the record.
@type template: unicode
@param template:
- The template string to be applied to the record in order
to obtain a new representation.
- The substitution mechanism is: C{"{tablename.fieldname}"} or
C{"{referencetablename.fieldname}"}.
template (unicode): the template string to be applied to the value
in order to obtain a new representation. The substitution
mechanism is: ``"{tablename.fieldname}"`` or
``"{referencetablename.fieldname}"``.
@type record: gluon.dal.Row
@param record: the database row to be manipulated
- Contain the table C{publications} and all reference tables.
record (gluon.dal.Row): the database row to be manipulated.
It contains the table *publications* and all foreign tables.
@rtype: unicode
@return:
Returns:
unicode:
"""
......@@ -73,22 +65,19 @@ def highlight_my_speaker(value, template, record):
"""Highlight the name of the speaker of my institute (bold)
and my authors (underline).
@type value: unicode
@param value: the current string representing the record
Args:
value (unicode): the current string representing the record.
@type template: unicode
@param template:
- The template string to be applied to the record in order
to obtain a new representation.
- The substitution mechanism is: C{"{tablename.fieldname}"} or
C{"{referencetablename.fieldname}"}.
template (unicode): the template string to be applied to the value
in order to obtain a new representation. The substitution
mechanism is: ``"{tablename.fieldname}"`` or
``"{referencetablename.fieldname}"``.
@type record: gluon.dal.Row
@param record: the database row to be manipulated
- Contain the table C{publications} and all reference tables.
record (gluon.dal.Row): the database row to be manipulated.
It contains the table *publications* and all foreign tables.
@rtype: unicode
@return:
Returns:
unicode:
"""
......@@ -110,24 +99,21 @@ def highlight_my_speaker(value, template, record):
def remove_undef(value, template, record):
"""Remove the C{UNDEF} string.
"""Remove the ``UNDEF`` string.
@type value: unicode
@param value: the current string representing the record
Args:
value (unicode): the current string representing the record.
@type template: unicode
@param template:
- The template string to be applied to the record in order
to obtain a new representation.
- The substitution mechanism is: C{"{tablename.fieldname}"} or
C{"{referencetablename.fieldname}"}.
template (unicode): the template string to be applied to the value
in order to obtain a new representation. The substitution
mechanism is: ``"{tablename.fieldname}"`` or
``"{referencetablename.fieldname}"``.
@type record: gluon.dal.Row
@param record: the database row to be manipulated
- Contain the table C{publications} and all reference tables.
record (gluon.dal.Row): the database row to be manipulated.
It contains the table *publications* and all foreign tables.
@rtype: unicode
@return:
Returns:
unicode:
"""
undef = current.T(plugin_dbui.UNDEF)
......
Markdown is supported
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