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
61ff6f09
Commit
61ff6f09
authored
Oct 26, 2015
by
LE GAC Renaud
Browse files
Abbreviation of revue follow the ISO 4 standard (with dot).
parent
78a80252
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
28 deletions
+5
-28
models/db0_publishers.py
models/db0_publishers.py
+1
-1
modules/filters.py
modules/filters.py
+0
-22
modules/harvest_tools/checkandfix.py
modules/harvest_tools/checkandfix.py
+4
-5
No files found.
models/db0_publishers.py
View file @
61ff6f09
...
...
@@ -13,4 +13,4 @@ db.publishers._before_delete.append(dbui.INHIBIT_DELETE_UNDEF)
db
.
publishers
.
_before_update
.
append
(
dbui
.
INHIBIT_UPDATE_UNDEF
)
db
.
publishers
.
publisher
.
filter_in
=
dbui
.
CLEAN_SPACES
db
.
publishers
.
abbreviation
.
filter_in
=
filters
.
CLEAN_REVIEW
\ No newline at end of file
db
.
publishers
.
abbreviation
.
filter_in
=
dbui
.
CLEAN_SPACES
\ No newline at end of file
modules/filters.py
View file @
61ff6f09
...
...
@@ -42,28 +42,6 @@ def CLEAN_COLLABORATION(value):
return
', '
.
join
(
li
)
def
CLEAN_REVIEW
(
value
):
"""Correct stupid mistakes on the paper_editor field.
* Remove dot and comma.
* No heading and trailing spaces.
Args:
value (unicode): review abbreviation
Returns:
unicode:
"""
# Fix to remove dot and comma
value
=
value
.
replace
(
"."
,
""
).
replace
(
","
,
""
)
# Fix to have only one space between word
value
=
' '
.
join
(
value
.
split
())
return
value
def
CLEAN_THESIS_DEFENSE
(
value
):
"""Correct stupid mistakes on the thesis defence field.
...
...
modules/harvest_tools/checkandfix.py
View file @
61ff6f09
...
...
@@ -16,9 +16,8 @@ from invenio_tools import (load_record,
REG_AUTHOR
,
REG_OAI
,
REG_YEAR
)
from
filters
import
CLEAN_REVIEW
from
gluon
import
current
from
plugin_dbui
import
get_id
from
plugin_dbui
import
CLEAN_SPACES
,
get_id
DECODE_ARXIV
=
re
.
compile
(
r
"arXiv:(\d{2})(\d{2})\."
)
...
...
@@ -493,7 +492,7 @@ class CheckAndFix(object):
INVENIO: Phys. Lett. B + volume 673
INSPIREHEP: Phys.Lett + volume B673
Standardise the answer as ``Phys Lett B``.
Standardise the answer as ``Phys
.
Lett
.
B``.
Note:
It is recommended to call this method when erratum are removed.
...
...
@@ -525,7 +524,7 @@ class CheckAndFix(object):
volume
=
m
.
group
(
2
)
# remove stupid mistake
editor
=
CLEAN_
REVIEW
(
editor
)
editor
=
CLEAN_
SPACES
(
editor
)
record
[
u
"773"
][
"p"
]
=
editor
record
[
u
"773"
][
"v"
]
=
volume
...
...
@@ -549,7 +548,7 @@ class CheckAndFix(object):
editor
=
"%s %s"
%
(
editor
,
m
.
group
(
1
))
volume
=
m
.
group
(
2
)
editor
=
CLEAN_
REVIEW
(
editor
)
editor
=
CLEAN_
SPACES
(
editor
)
record
[
u
"773"
][
i
][
"p"
]
=
editor
record
[
u
"773"
][
i
][
"v"
]
=
volume
...
...
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