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
199d216f
Commit
199d216f
authored
Jan 16, 2021
by
LE GAC Renaud
Browse files
Fix typos discover running harvester
parent
aa2c3bed
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
45 additions
and
34 deletions
+45
-34
controllers/harvest.py
controllers/harvest.py
+6
-6
modules/harvest_tools/articles.py
modules/harvest_tools/articles.py
+2
-1
modules/harvest_tools/automaton.py
modules/harvest_tools/automaton.py
+1
-1
modules/harvest_tools/base.py
modules/harvest_tools/base.py
+1
-1
modules/harvest_tools/notes.py
modules/harvest_tools/notes.py
+2
-1
modules/harvest_tools/preprints.py
modules/harvest_tools/preprints.py
+2
-1
modules/harvest_tools/proceedings.py
modules/harvest_tools/proceedings.py
+2
-1
modules/harvest_tools/reports.py
modules/harvest_tools/reports.py
+2
-1
modules/harvest_tools/talks.py
modules/harvest_tools/talks.py
+2
-1
modules/harvest_tools/thesis.py
modules/harvest_tools/thesis.py
+2
-1
modules/store_tools/recordcdspubli.py
modules/store_tools/recordcdspubli.py
+6
-6
modules/store_tools/recordheppubli.py
modules/store_tools/recordheppubli.py
+17
-13
No files found.
controllers/harvest.py
View file @
199d216f
...
...
@@ -9,20 +9,20 @@ from gluon import current
from
gluon.restricted
import
RestrictedError
from
harvest_tools
import
(
build_harvester_tool
,
CheckAndFix
,
CheckException
,
DRY_RUN
,
MsgCollection
,
search_synonym
,
ToolException
)
MsgCollection
)
from
plugin_dbui
import
(
inline_alert
,
Selector
,
to_formPanel
,
UNDEF_ID
)
from
requests.exceptions
import
RequestException
from
store_tools
import
(
load_record
,
from
store_tools
import
(
CheckException
,
load_record
,
OAI_URL
,
RecordCdsConfPaper
,
RecordCdsThesis
)
RecordCdsThesis
,
search_synonym
,
ToolException
)
MODE_DRY_RUN
=
T
(
DRY_RUN
)
MSG_GREMLIN
=
"Oops a gremlin..."
...
...
modules/harvest_tools/articles.py
View file @
199d216f
...
...
@@ -65,8 +65,9 @@ class Articles(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record
.
check_and_fix
(
self
.
rex_institute
,
record
.
check_and_fix
(
db
=
self
.
db
,
fmt_author
=
"F. Last"
,
rex_institute
=
self
.
rex_institute
,
sep_author
=
", "
,
sort_author
=
True
)
...
...
modules/harvest_tools/automaton.py
View file @
199d216f
...
...
@@ -131,7 +131,7 @@ class Automaton(object):
self
.
id_project
=
id_project
self
.
logs
=
[]
self
.
logger
=
logging
.
getLogger
(
"web2py.app.limbra"
)
self
.
rex_intitute
=
get_rex_institute
(
db
,
current
.
app
)
self
.
rex_in
s
titute
=
get_rex_institute
(
db
,
current
.
app
)
self
.
store
=
None
self
.
year_start
=
year_start
self
.
year_end
=
year_end
...
...
modules/harvest_tools/base.py
View file @
199d216f
...
...
@@ -138,6 +138,6 @@ def get_rex_institute(db, app):
lst
.
append
(
val
)
reg_institute
=
r
"|"
.
join
(
lst
)
app
.
reg_institute
=
reg_institute
=
r
"|"
.
join
(
lst
)
return
reg_institute
modules/harvest_tools/notes.py
View file @
199d216f
...
...
@@ -45,8 +45,9 @@ class Notes(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record
.
check_and_fix
(
self
.
rex_institute
,
record
.
check_and_fix
(
db
=
self
.
db
,
fmt_author
=
"F. Last"
,
rex_institute
=
self
.
rex_institute
,
sep_author
=
", "
,
sort_author
=
True
)
...
...
modules/harvest_tools/preprints.py
View file @
199d216f
...
...
@@ -69,8 +69,9 @@ class Preprints(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record
.
check_and_fix
(
self
.
rex_institute
,
record
.
check_and_fix
(
db
=
self
.
db
,
fmt_author
=
"F. Last"
,
rex_institute
=
self
.
rex_institute
,
sep_author
=
", "
,
sort_author
=
True
)
...
...
modules/harvest_tools/proceedings.py
View file @
199d216f
...
...
@@ -51,8 +51,9 @@ class Proceedings(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record
.
check_and_fix
(
self
.
rex_institute
,
record
.
check_and_fix
(
db
=
self
.
db
,
fmt_author
=
"F. Last"
,
rex_institute
=
self
.
rex_institute
,
sep_author
=
", "
,
sort_author
=
True
)
...
...
modules/harvest_tools/reports.py
View file @
199d216f
...
...
@@ -45,8 +45,9 @@ class Reports(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record
.
check_and_fix
(
self
.
rex_institute
,
record
.
check_and_fix
(
db
=
self
.
db
,
fmt_author
=
"F. Last"
,
rex_institute
=
self
.
rex_institute
,
sep_author
=
", "
,
sort_author
=
True
)
...
...
modules/harvest_tools/talks.py
View file @
199d216f
...
...
@@ -50,8 +50,9 @@ class Talks(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record
.
check_and_fix
(
self
.
rex_institute
,
record
.
check_and_fix
(
db
=
self
.
db
,
fmt_author
=
"F. Last"
,
rex_institute
=
self
.
rex_institute
,
sep_author
=
", "
,
sort_author
=
True
)
...
...
modules/harvest_tools/thesis.py
View file @
199d216f
...
...
@@ -42,8 +42,9 @@ class Thesis(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record
.
check_and_fix
(
self
.
rex_institute
,
record
.
check_and_fix
(
db
=
self
.
db
,
fmt_author
=
"F. Last"
,
rex_institute
=
self
.
rex_institute
,
sep_author
=
", "
,
sort_author
=
True
)
...
...
modules/store_tools/recordcdspubli.py
View file @
199d216f
...
...
@@ -555,12 +555,12 @@ class RecordCdsPubli(dict, AuthorsMixin, PublicationInfoMixin):
else
:
self
[
"prepublication"
]
=
{
"date"
:
date
}
def
check_and_fix
_record
(
self
,
db
=
None
,
fmt_author
=
None
,
rex_institute
=
None
,
sep_author
=
", "
,
sort_author
=
False
):
def
check_and_fix
(
self
,
db
=
None
,
fmt_author
=
None
,
rex_institute
=
None
,
sep_author
=
", "
,
sort_author
=
False
):
"""Check record and fix non-conformities.
* is with authors
...
...
modules/store_tools/recordheppubli.py
View file @
199d216f
...
...
@@ -10,7 +10,7 @@ from .base import (search_synonym,
MSG_WELL_FORMED_DATE
,
REG_DATE_YYYYMM
,
T4
,
T6
)
from
.exception
import
CheckException
from
.exception
import
CheckException
,
ToolException
from
filters
import
CLEAN_COLLABORATION
from
pandas
import
DataFrame
from
.publicationinfomixin
import
PublicationInfoMixin
...
...
@@ -237,13 +237,17 @@ class RecordHepPubli(dict, AuthorsMixin, PublicationInfoMixin):
if
len
(
val
)
==
0
:
return
dbid
=
search_synonym
(
db
.
collaborations
,
"collaboration"
,
val
)
if
dbid
==
UNDEF_ID
:
raise
CheckException
(
MSG_UNKNOWN_COLLABORATION
)
try
:
dbid
=
search_synonym
(
db
.
collaborations
,
"collaboration"
,
val
)
if
dbid
==
UNDEF_ID
:
raise
CheckException
(
MSG_UNKNOWN_COLLABORATION
)
collaboration
=
db
.
collaborations
[
dbid
].
collaboration
if
collaboration
!=
val
:
self
[
"collaborations"
]
=
[{
"value"
:
collaboration
}]
collaboration
=
db
.
collaborations
[
dbid
].
collaboration
if
collaboration
!=
val
:
self
[
"collaborations"
]
=
[{
"value"
:
collaboration
}]
except
ToolException
as
e
:
raise
CheckException
(
e
)
def
check_my_affiliation
(
self
,
rex_institute
=
None
):
"""Check that authors of my institute are signatories.
...
...
@@ -285,12 +289,12 @@ class RecordHepPubli(dict, AuthorsMixin, PublicationInfoMixin):
if
not
REG_DATE_YYYYMM
.
match
(
xdate
):
raise
CheckException
(
MSG_WELL_FORMED_DATE
)
def
check_and_fix
_record
(
self
,
db
=
None
,
fmt_author
=
None
,
rex_institute
=
None
,
sep_author
=
", "
,
sort_author
=
False
):
def
check_and_fix
(
self
,
db
=
None
,
fmt_author
=
None
,
rex_institute
=
None
,
sep_author
=
", "
,
sort_author
=
False
):
"""Check record and fix non-conformities.
* is with authors
...
...
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