Commit 6b8eb14e authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Sphinx documentation for the module filters.

parent d9f5c7de
filters.CLEAN_COLLABORATION
===========================
.. currentmodule:: filters
.. autofunction:: CLEAN_COLLABORATION
\ No newline at end of file
filters.CLEAN_REVIEW
====================
.. currentmodule:: filters
.. autofunction:: CLEAN_REVIEW
\ No newline at end of file
filters.CLEAN_THESIS_DEFENSE
============================
.. currentmodule:: filters
.. autofunction:: CLEAN_THESIS_DEFENSE
\ No newline at end of file
......@@ -38,4 +38,19 @@ rules.
~duplicate_article
~duplicate_conference
~duplicate_origin
~duplicate_report
\ No newline at end of file
~duplicate_report
filters
^^^^^^^
A collections of functions to correct field values before their
insertion / update in the database.
.. currentmodule:: filters
.. autosummary::
:toctree: generated/
~CLEAN_COLLABORATION
~CLEAN_REVIEW
~CLEAN_THESIS_DEFENSE
"""a collections of functions to correct entries in the database.
@author: R. Le Gac
"""
def CLEAN_COLLABORATION(value):
"""Correct stupid mistakes on the collaboration field.
- No heading and trailing spaces
- No duplicate entries
- Remove entries starting with C{on behalf}
- Collaboration always start with a Capital letter
* No heading and trailing spaces.
* No duplicate entries.
* Remove entries starting with *on behalf*.
* Collaboration always start with a Capital letter.
@type value: str
@param value: string where collaborations are separated by comma
Args:
value (unicode): string where collaborations are separated by comma
@rtype: str
Returns:
unicode:
"""
li = []
......@@ -46,13 +45,14 @@ def CLEAN_COLLABORATION(value):
def CLEAN_REVIEW(value):
"""Correct stupid mistakes on the paper_editor field.
- Remove dot and coma
- No heading and trailing spaces
* Remove dot and comma.
* No heading and trailing spaces.
@type value: str
@param value: review abbreviation
Args:
value (unicode): review abbreviation
@rtype: str
Returns:
unicode:
"""
# Fix to remove dot and comma
......@@ -65,14 +65,15 @@ def CLEAN_REVIEW(value):
def CLEAN_THESIS_DEFENSE(value):
"""Correct stupid mistakes on the thesis_defense field.
"""Correct stupid mistakes on the thesis defence field.
- Remove prefix like C{Presented}, C{on}, ...
* Remove prefix like *Presented*, *on*, *etc*.
@type value: str
@param value: string with the defense date
Args:
value (unicode): string with the defence date
@rtype: str
Returns:
unicode:
"""
value = value.replace('Presented ', '')
......
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