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

Sphinx documentation for the Thesis class.

parent 11f4dfda
harvest_tools.thesis.Thesis
===========================
.. currentmodule:: harvest_tools.thesis
.. autoclass:: Thesis
:show-inheritance:
.. rubric:: Methods
.. autosummary::
:toctree: thesis/
~Thesis.check_record
~Thesis.decode_xml
~Thesis.get_create_collaboration
~Thesis.get_create_publisher
~Thesis.get_record_by_fields
~Thesis.insert_record
~Thesis.process_url
~Thesis.process_xml
~Thesis.report
harvest_tools.thesis.Thesis.check_record
========================================
.. currentmodule:: harvest_tools.thesis
.. automethod:: Thesis.check_record
\ No newline at end of file
harvest_tools.thesis.Thesis.decode_xml
======================================
.. currentmodule:: harvest_tools.thesis
.. automethod:: Thesis.decode_xml
\ No newline at end of file
harvest_tools.thesis.Thesis.get_create_collaboration
====================================================
.. currentmodule:: harvest_tools.thesis
.. automethod:: Thesis.get_create_collaboration
\ No newline at end of file
harvest_tools.thesis.Thesis.get_create_publisher
================================================
.. currentmodule:: harvest_tools.thesis
.. automethod:: Thesis.get_create_publisher
\ No newline at end of file
harvest_tools.thesis.Thesis.get_record_by_fields
================================================
.. currentmodule:: harvest_tools.thesis
.. automethod:: Thesis.get_record_by_fields
\ No newline at end of file
harvest_tools.thesis.Thesis.insert_record
=========================================
.. currentmodule:: harvest_tools.thesis
.. automethod:: Thesis.insert_record
\ No newline at end of file
harvest_tools.thesis.Thesis.process_url
=======================================
.. currentmodule:: harvest_tools.thesis
.. automethod:: Thesis.process_url
\ No newline at end of file
harvest_tools.thesis.Thesis.process_xml
=======================================
.. currentmodule:: harvest_tools.thesis
.. automethod:: Thesis.process_xml
\ No newline at end of file
harvest_tools.thesis.Thesis.report
==================================
.. currentmodule:: harvest_tools.thesis
.. automethod:: Thesis.report
\ No newline at end of file
......@@ -102,3 +102,10 @@ Classes
:toctree: generated/
Talks
.. currentmodule:: harvest_tools.thesis
.. autosummary::
:toctree: generated/
Thesis
......@@ -22,12 +22,12 @@ class Thesis(Automaton):
def check_record(self, record):
"""Check the content of the thesis in order to fix non conformities.
@type record: L{Record}
@param record:
Args:
record (RecordThesis): record describing a thesis.
@rtype: bool
@return: C{False} when a non conformity is found and can not be
corrected.
Returns:
bool: ``False`` when a non conformity is found and can not be
corrected.
"""
if not Automaton.check_record(self, record):
......@@ -63,12 +63,12 @@ class Thesis(Automaton):
def insert_record(self, record):
"""Insert a thesis in the database.
@type record: L{Record}
@param record:
Args:
record (RecordThesis): record describing a thesis.
@rtype: int
@return: one when the record is inserted / updated in the database
zero otherwise.
Returns:
int: one when the record is inserted / updated in the database
zero otherwise.
"""
db = self.db
......@@ -102,20 +102,20 @@ class Thesis(Automaton):
ret = 1
if not self.dry_run:
fields = dict(authors=first_author,
authors_institute=first_author,
defense=defense_date,
directors=record.these_directors(),
first_author=first_author,
id_categories=id_category,
id_teams=self.id_team,
id_projects=self.id_project,
id_status=UNDEF_ID,
origin=oai_url,
publication_url=record.paper_url(),
submitted=record.submitted()[0],
title=title,
universities=universities,
year=year)
authors_institute=first_author,
defense=defense_date,
directors=record.these_directors(),
first_author=first_author,
id_categories=id_category,
id_teams=self.id_team,
id_projects=self.id_project,
id_status=UNDEF_ID,
origin=oai_url,
publication_url=record.paper_url(),
submitted=record.submitted()[0],
title=title,
universities=universities,
year=year)
ret = self._insert_in_db(log_year=year, **fields)
......
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