Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
limbra
limbra
Commits
378867e0
Commit
378867e0
authored
Jan 15, 2021
by
LE GAC Renaud
Browse files
Rename RecordCdsConf as RecordCdsConfPaper
parent
e80f30a2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
42 additions
and
41 deletions
+42
-41
controllers/harvest.py
controllers/harvest.py
+2
-2
modules/harvest_tools/checkandfix.py
modules/harvest_tools/checkandfix.py
+8
-8
modules/harvest_tools/preprints.py
modules/harvest_tools/preprints.py
+2
-2
modules/store_tools/__init__.py
modules/store_tools/__init__.py
+7
-4
modules/store_tools/factory.py
modules/store_tools/factory.py
+3
-3
modules/store_tools/recordcdsconfpaper.py
modules/store_tools/recordcdsconfpaper.py
+2
-2
tests/basis/test_02_factory_tools.py
tests/basis/test_02_factory_tools.py
+17
-19
tests/basis/test_06_RecordCdsConfPaper.py
tests/basis/test_06_RecordCdsConfPaper.py
+1
-1
No files found.
controllers/harvest.py
View file @
378867e0
...
...
@@ -21,7 +21,7 @@ from plugin_dbui import (inline_alert,
from
requests.exceptions
import
RequestException
from
store_tools
import
(
load_record
,
OAI_URL
,
RecordCdsConf
,
RecordCdsConf
Paper
,
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
,
RecordCdsConf
Paper
):
values
[
"PublicationsConference_title"
]
=
\
record
.
conference_title
()
...
...
modules/harvest_tools/checkandfix.py
View file @
378867e0
...
...
@@ -11,7 +11,7 @@ from store_tools import (CheckException,
MSG_NO_CONF
,
MSG_NO_THESIS
,
OAI_URL
,
RecordCdsConf
,
RecordCdsConf
Paper
,
RecordCdsPubli
,
RecordCdsThesis
,
RecordHepConfPaper
,
...
...
@@ -103,7 +103,7 @@ class CheckAndFix(object):
"""Return the opening and closing dates of a conference.
Args:
record (RecordCdsConf):
record (RecordCdsConf
Paper
):
record describing a conference proceeding or talk.
Returns:
...
...
@@ -316,7 +316,7 @@ class CheckAndFix(object):
"""
val
=
""
if
isinstance
(
record
,
RecordCdsConf
):
if
isinstance
(
record
,
RecordCdsConf
Paper
):
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
,
(
RecordCdsConf
Paper
,
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
,
RecordCdsConf
Paper
):
return
val
=
record
.
conference_country
()
...
...
@@ -473,7 +473,7 @@ class CheckAndFix(object):
"""Check conference date exists and well formatted.
Args:
record (RecordCdsConf):
record (RecordCdsConf
Paper
):
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
,
RecordCdsConf
Paper
):
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
,
RecordCdsConf
Paper
):
if
"meeting_name"
in
record
:
return
...
...
modules/harvest_tools/preprints.py
View file @
378867e0
...
...
@@ -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
RecordCdsConf
Paper
,
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
,
RecordCdsConf
Paper
):
self
.
logs
[
-
1
].
reject
(
MSG_PREPRINT_IS_CONFERENCE
,
record
=
record
)
return
False
...
...
modules/store_tools/__init__.py
View file @
378867e0
...
...
@@ -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
.recordcdsconf
paper
import
RecordCdsConf
Paper
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 RecordCdsConf
Paper
, RecordHepConfPaper, RecodHepPubli, RecordHepInst,
RecordHepThesis, RecordHepInst, RecordCdsPubli or RecordCdsThesis
Raises:
...
...
modules/store_tools/factory.py
View file @
378867e0
...
...
@@ -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
.recordcdsconf
paper
import
RecordCdsConf
Paper
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 RecordCdsConf
Paper
, 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
=
RecordCdsConf
Paper
(
recjson
)
elif
is_institute
(
recjson
):
raise
RecordException
(
MSG_ERROR_INST
)
...
...
modules/store_tools/recordcdsconf.py
→
modules/store_tools/recordcdsconf
paper
.py
View file @
378867e0
""" store_tools.recordcdsconf
""" store_tools.recordcdsconf
paper
"""
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
RecordCdsConf
Paper
(
RecordCdsPubli
):
"""The record describing a conference talk or a proceeding.
Additional field describing the conference data are:
...
...
tests/basis/test_02_factory_tools.py
View file @
378867e0
...
...
@@ -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
,
RecordCdsConf
Paper
)
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
,
RecordCdsConf
Paper
)
# ............................................................................
#
...
...
tests/basis/test_06_RecordCdsConf.py
→
tests/basis/test_06_RecordCdsConf
Paper
.py
View file @
378867e0
"""test_06_RecordCdsConf
"""test_06_RecordCdsConf
Paper
Test specific methods of the RecordConf class for ::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment