Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82427337
bfe_publi_info.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Sep 11, 08:48
Size
2 KB
Mime Type
text/x-python
Expires
Fri, Sep 13, 08:48 (2 d)
Engine
blob
Format
Raw Data
Handle
20691132
Attached To
R3600 invenio-infoscience
bfe_publi_info.py
View Options
# -*- coding: utf-8 -*-
##
## $Id$
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## CDS Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with CDS Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
__revision__
=
"$Id$"
def
format
(
bfo
):
"""
Displays inline publication information with html link to ejournal
(when available).
"""
from
urllib
import
quote
out
=
''
publication_info
=
bfo
.
field
(
'909C4'
)
if
publication_info
==
""
:
return
""
journal
=
bfo
.
kb
(
'ejournals'
,
publication_info
.
get
(
'p'
))
volume
=
publication_info
.
get
(
'v'
)
year
=
publication_info
.
get
(
'y'
)
number
=
publication_info
.
get
(
'n'
)
pages
=
publication_info
.
get
(
'c'
)
if
journal
!=
''
and
volume
!=
None
:
out
+=
'<a href="http://weblib.cern.ch/cgi-bin/ejournals?publication='
out
+=
quote
(
publication_info
.
get
(
'p'
))
out
+=
'&volume='
+
volume
out
+=
'&year='
+
year
out
+=
'&page='
page
=
pages
.
split
(
'-'
)
# get first page from range
if
len
(
page
)
>
0
:
out
+=
page
[
0
]
out
+=
'">
%(journal)s
:
%(volume)s
%(year)s
%(page)s
</a>'
%
{
'journal'
:
journal
,
'volume'
:
volume
,
'year'
:
year
,
'page'
:
pages
}
else
:
out
+=
publication_info
.
get
(
'p'
)
+
': '
if
volume
!=
None
:
out
+=
volume
if
year
!=
None
:
out
+=
' ('
+
year
+
') '
if
number
!=
None
:
out
+=
'no. '
+
number
+
', '
if
pages
!=
None
:
out
+=
'pp. '
+
pages
return
out
Event Timeline
Log In to Comment