Commit 378867e0 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Rename RecordCdsConf as RecordCdsConfPaper

parent e80f30a2
......@@ -21,7 +21,7 @@ from plugin_dbui import (inline_alert,
from requests.exceptions import RequestException
from store_tools import (load_record,
OAI_URL,
RecordCdsConf,
RecordCdsConfPaper,
RecordCdsThesis)
MODE_DRY_RUN = T(DRY_RUN)
......@@ -267,7 +267,7 @@ def edit_insert():
logger.debug(str(e))
pass
if isinstance(record, RecordCdsConf):
if isinstance(record, RecordCdsConfPaper):
values["PublicationsConference_title"] = \
record.conference_title()
......
......@@ -11,7 +11,7 @@ from store_tools import (CheckException,
MSG_NO_CONF,
MSG_NO_THESIS,
OAI_URL,
RecordCdsConf,
RecordCdsConfPaper,
RecordCdsPubli,
RecordCdsThesis,
RecordHepConfPaper,
......@@ -103,7 +103,7 @@ class CheckAndFix(object):
"""Return the opening and closing dates of a conference.
Args:
record (RecordCdsConf):
record (RecordCdsConfPaper):
record describing a conference proceeding or talk.
Returns:
......@@ -316,7 +316,7 @@ class CheckAndFix(object):
"""
val = ""
if isinstance(record, RecordCdsConf):
if isinstance(record, RecordCdsConfPaper):
opening = self._get_conference_dates(record)[0]
val = opening.strftime("%Y-%m-%d")
......@@ -340,7 +340,7 @@ class CheckAndFix(object):
# last change use the creation date for the record
if val == "" or len(val) < 7:
if isinstance(record, (RecordCdsConf, RecordCdsPubli, RecordCdsThesis)):
if isinstance(record, (RecordCdsConfPaper, RecordCdsPubli, RecordCdsThesis)):
val = record["creation_date"][0:7]
else:
......@@ -435,7 +435,7 @@ class CheckAndFix(object):
"""
self.logger.debug(f"{T6}check country")
if not isinstance(record, RecordCdsConf):
if not isinstance(record, RecordCdsConfPaper):
return
val = record.conference_country()
......@@ -473,7 +473,7 @@ class CheckAndFix(object):
"""Check conference date exists and well formatted.
Args:
record (RecordCdsConf):
record (RecordCdsConfPaper):
record describing a talk or a proceeding.
Raises:
......@@ -484,7 +484,7 @@ class CheckAndFix(object):
self.logger.debug(f"{T6}check conference date")
# conference information are available, i.e proceeding
if not isinstance(record, RecordCdsConf):
if not isinstance(record, RecordCdsConfPaper):
return
val = record.conference_dates()
......@@ -739,7 +739,7 @@ class CheckAndFix(object):
"""
self.logger.debug(f"{T6}is conference")
if isinstance(record, RecordCdsConf):
if isinstance(record, RecordCdsConfPaper):
if "meeting_name" in record:
return
......
......@@ -5,7 +5,7 @@ from .automaton import Automaton
from .base import MSG_CRASH, MSG_LOAD
from .checkandfix import CheckException
from plugin_dbui import get_id, UNDEF_ID
from store_tools import RecordCdsConf, RecordCdsThesis
from store_tools import RecordCdsConfPaper, RecordCdsThesis
MSG_PREPRINT_IS_PAPER = "Reject preprint is a published paper"
MSG_PREPRINT_IS_CONFERENCE = "Reject preprint is a conference"
......@@ -42,7 +42,7 @@ class Preprints(Automaton):
self.logs[-1].reject(MSG_PREPRINT_IS_PAPER, record=record)
return False
if isinstance(record, RecordCdsConf):
if isinstance(record, RecordCdsConfPaper):
self.logs[-1].reject(MSG_PREPRINT_IS_CONFERENCE, record=record)
return False
......
......@@ -4,7 +4,7 @@ Note:
details on the invenio API at http://invenio-software.org/
"""
from .authorsmixin import AuthorsMixin
from .authorsmixin import AuthorsMixin, to_initial
from .base import (ARXIV,
ARXIV_PDF,
is_conference,
......@@ -33,11 +33,14 @@ from .exception import (CheckException,
StoreException,
ToolException)
from .factory import build_record, build_store
from .factory import (add_conference_data,
build_record,
build_store,
get_conference_data)
from .inspirehepstore import InspirehepStore
from .publicationinfomixin import PublicationInfoMixin
from .cdsstore import CdsStore
from .recordcdsconf import RecordCdsConf
from .recordcdsconfpaper import RecordCdsConfPaper
from .recordcdspubli import RecordCdsPubli
from .recordcdsthesis import RecordCdsThesis
from .recordhepconfpaper import RecordHepConfPaper
......@@ -76,7 +79,7 @@ def load_record(host, record_id, shelf=None):
Returns:
RecordCds:
either RecordCdsConf, RecordHepConfPaper, RecodHepPubli, RecordHepInst,
either RecordCdsConfPaper, RecordHepConfPaper, RecodHepPubli, RecordHepInst,
RecordHepThesis, RecordHepInst, RecordCdsPubli or RecordCdsThesis
Raises:
......
......@@ -16,7 +16,7 @@ from datetime import datetime
from .exception import RecordException, StoreException
from .cdsstore import CdsStore
from .inspirehepstore import InspirehepStore, SHELFS
from .recordcdsconf import RecordCdsConf
from store_tools.recordcdsconfpaper import RecordCdsConfPaper
from .recordhepconfpaper import RecordHepConfPaper
from .recordheppubli import RecordHepPubli
from .recordhepinst import RecordHepInst
......@@ -185,7 +185,7 @@ def build_record(recjson, shelf=None):
Return
Record:
either RecordCdsConf, RecordHepConfPaper, RecodHepPubli, RecordHepInst,
either RecordCdsConfPaper, RecordHepConfPaper, RecodHepPubli, RecordHepInst,
RecordHepThesis, RecordHepInst, RecordCdsPubli or RecordCdsThesis
Raises:
......@@ -199,7 +199,7 @@ def build_record(recjson, shelf=None):
if shelf is None:
if is_conference(recjson):
add_conference_data(recjson)
upcast_record = RecordCdsConf(recjson)
upcast_record = RecordCdsConfPaper(recjson)
elif is_institute(recjson):
raise RecordException(MSG_ERROR_INST)
......
""" store_tools.recordcdsconf
""" store_tools.recordcdsconfpaper
"""
from .base import REG_CONF, REG_YEAR
......@@ -6,7 +6,7 @@ from plugin_dbui import CLEAN_SPACES
from store_tools.recordcdspubli import RecordCdsPubli
class RecordCdsConf(RecordCdsPubli):
class RecordCdsConfPaper(RecordCdsPubli):
"""The record describing a conference talk or a proceeding.
Additional field describing the conference data are:
......
......@@ -5,23 +5,21 @@
* Test tools to get / add conference data.
"""
from store_tools.base import (is_conference,
is_institute,
is_thesis)
from store_tools.factory import (add_conference_data,
build_record,
build_store,
get_conference_data)
from store_tools.authorsmixin import to_initial
from store_tools.recordcdsconf import RecordCdsConf
from store_tools.recordcdspubli import RecordCdsPubli
from store_tools.recordcdsthesis import RecordCdsThesis
from store_tools.recordhepconfpaper import RecordHepConfPaper
from store_tools.recordhepinst import RecordHepInst
from store_tools.recordheppubli import RecordHepPubli
from store_tools.recordhepthesis import RecordHepThesis
from store_tools import (add_conference_data,
build_record,
build_store,
get_conference_data,
is_conference,
is_institute,
is_thesis,
RecordCdsConfPaper,
RecordCdsPubli,
RecordCdsThesis,
RecordHepConfPaper,
RecordHepInst,
RecordHepPubli,
RecordHepThesis,
to_initial)
# ............................................................................
......@@ -104,7 +102,7 @@ def test_conference_cds_02006():
assert not is_thesis(recjson)
record = build_record(recjson)
assert isinstance(record, RecordCdsConf)
assert isinstance(record, RecordCdsConfPaper)
def test_conference_ins_02007():
......@@ -130,7 +128,7 @@ def test_talk_cds_02008():
assert not is_thesis(recjson)
record = build_record(recjson)
assert isinstance(record, RecordCdsConf)
assert isinstance(record, RecordCdsConfPaper)
# ............................................................................
#
......
"""test_06_RecordCdsConf
"""test_06_RecordCdsConfPaper
Test specific methods of the RecordConf class for ::
......
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