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
adb42593
Commit
adb42593
authored
Apr 27, 2016
by
LE GAC Renaud
Browse files
Fix Record.conf.conference_dates for record from inspirehep.
parent
822ff81e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
modules/invenio_tools/recordconf.py
modules/invenio_tools/recordconf.py
+28
-1
No files found.
modules/invenio_tools/recordconf.py
View file @
adb42593
...
...
@@ -2,11 +2,18 @@
""" invenio_tools.recordconf
"""
import
re
from
base
import
REG_YEAR
from
datetime
import
datetime
from
plugin_dbui
import
CLEAN_SPACES
from
recordpubli
import
RecordPubli
REG_DATE
=
re
.
compile
(
r
"(\d{4}-\d{2}-\d{2})"
)
class
RecordConf
(
RecordPubli
):
"""The MARC record describing a conference talk or a proceeding.
The relation between methods and MARC fields are the following::
...
...
@@ -38,7 +45,27 @@ class RecordConf(RecordPubli):
standardise.
"""
return
self
.
_get
(
u
"111"
,
"d"
)
if
self
.
host
().
startswith
(
"inspirehep"
):
start
=
self
.
_get
(
u
"111"
,
"x"
)
end
=
self
.
_get
(
u
"111"
,
"y"
)
if
not
(
REG_DATE
.
match
(
start
)
and
REG_DATE
.
match
(
end
)):
return
u
''
ds
=
datetime
.
strptime
(
start
,
"%Y-%m-%d"
)
de
=
datetime
.
strptime
(
end
,
"%Y-%m-%d"
)
if
ds
.
month
==
de
.
month
:
value
=
"%i-%i %s"
%
(
ds
.
day
,
de
.
day
,
ds
.
strftime
(
"%b %Y"
))
else
:
tpl
=
(
ds
.
strftime
(
"%d %b"
),
de
.
strftime
(
"%d %b %Y"
))
value
=
"%s - %s"
%
tpl
else
:
value
=
self
.
_get
(
u
"111"
,
"d"
)
return
value
def
conference_country
(
self
):
"""The country where the conference took place.
...
...
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