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
172102fc
Commit
172102fc
authored
Sep 28, 2015
by
LE GAC Renaud
Browse files
Fix pylint warnings / errors in invenio_tools.
parent
7936b2a3
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
25 deletions
+20
-25
modules/invenio_tools/checkandfix.py
modules/invenio_tools/checkandfix.py
+2
-2
modules/invenio_tools/inveniostore.py
modules/invenio_tools/inveniostore.py
+5
-5
modules/invenio_tools/marc12.py
modules/invenio_tools/marc12.py
+6
-6
modules/invenio_tools/record.py
modules/invenio_tools/record.py
+0
-1
modules/invenio_tools/recordconf.py
modules/invenio_tools/recordconf.py
+0
-3
modules/invenio_tools/recordinst.py
modules/invenio_tools/recordinst.py
+1
-1
modules/invenio_tools/recordpubli.py
modules/invenio_tools/recordpubli.py
+5
-6
modules/invenio_tools/recordthesis.py
modules/invenio_tools/recordthesis.py
+1
-1
No files found.
modules/invenio_tools/checkandfix.py
View file @
172102fc
...
...
@@ -376,8 +376,8 @@ class CheckAndFix(object):
# check country information (all valid countries have been enter once)
db
=
self
.
db
id
=
get_id
(
db
.
countries
,
country
=
record
.
conference_country
())
if
not
id
:
id
_country
=
get_id
(
db
.
countries
,
country
=
record
.
conference_country
())
if
not
id
_country
:
raise
CheckException
(
MSG_NO_COUNTRY
)
def
conference_date
(
self
,
record
):
...
...
modules/invenio_tools/inveniostore.py
View file @
172102fc
...
...
@@ -195,11 +195,11 @@ class InvenioStore(object):
return
ids
def
get_record
(
self
,
id
):
"""Retrieve a record defined by its C{id} in the invenio store.
def
get_record
(
self
,
rec_
id
):
"""Retrieve a record defined by its C{
rec_
id} in the invenio store.
@type id: int
@param id:
@type
rec_
id: int
@param
rec_
id:
@rtype: unicode
@return: the XML string is compliant with
...
...
@@ -210,7 +210,7 @@ class InvenioStore(object):
"""
self
.
_try
=
0
url
=
'http://%s/record/%s/export/xm'
%
(
self
.
_host
,
id
)
url
=
'http://%s/record/%s/export/xm'
%
(
self
.
_host
,
rec_
id
)
return
self
.
interogate
(
url
)
def
last_search_url
(
self
):
...
...
modules/invenio_tools/marc12.py
View file @
172102fc
...
...
@@ -49,8 +49,8 @@ class Marc12(object):
raise
Marc12Exception
(
MSG_NO_CONF
)
# get conference information
id
=
record
.
reference_conference_id
()
conference
=
self
.
_get_conference
(
host
,
id
,
key
)
id
_conf
=
record
.
reference_conference_id
()
conference
=
self
.
_get_conference
(
host
,
id
_conf
,
key
)
# protection id can be a reference to other object like book
if
u
"111"
not
in
conference
:
...
...
@@ -110,7 +110,7 @@ class Marc12(object):
raise
Marc12Exception
(
MSG_NO_CONF
)
def
__call__
(
self
,
xml
,
filter
=
None
,
func
=
None
):
def
__call__
(
self
,
xml
,
filter
_func
=
None
,
func
=
None
):
"""Transform the the XML string into a list of L{Record}.
@type xml: unicode
...
...
@@ -134,8 +134,8 @@ class Marc12(object):
</record>
</collection>
@type filter: reference to a function
@param filter: A function to eliminate records which don't satisfy
@type filter
_func
: reference to a function
@param filter
_func
: A function to eliminate records which don't satisfy
functions criteria. The argument of the function is a Record while
the return value is a boolean.
...
...
@@ -166,7 +166,7 @@ class Marc12(object):
else
:
upcast_record
=
RecordPubli
(
record
)
if
filter
and
not
filter
(
upcast_record
):
if
filter
_func
and
not
filter
_func
(
upcast_record
):
continue
if
func
:
...
...
modules/invenio_tools/record.py
View file @
172102fc
...
...
@@ -6,7 +6,6 @@ import pprint
from
base
import
OAI_URL
,
REG_OAI
from
exception
import
RecordException
class
Record
(
dict
):
...
...
modules/invenio_tools/recordconf.py
View file @
172102fc
...
...
@@ -2,9 +2,6 @@
""" invenio_tools.recordconf
"""
import
re
from
base
import
REG_YEAR
from
plugin_dbui
import
CLEAN_SPACES
from
recordpubli
import
RecordPubli
...
...
modules/invenio_tools/recordinst.py
View file @
172102fc
...
...
@@ -39,7 +39,7 @@ class RecordInst(Record):
raise
RecordException
(
MSG_INVALID_RECORD
)
if
record
.
host
()
!=
'inspirehep.net'
:
raise
RecordException
(
MSG_INVALID_
INSTITUTE
)
raise
RecordException
(
MSG_INVALID_
HOST
)
Record
.
__init__
(
self
,
record
)
...
...
modules/invenio_tools/recordpubli.py
View file @
172102fc
...
...
@@ -9,8 +9,7 @@ from base import (ARXIV,
ARXIV_PDF
,
REG_ARXIV_NUMBER
,
REG_AUTHOR
,
REG_YEAR
,
THESIS_DIR
)
REG_YEAR
)
from
filters
import
CLEAN_COLLABORATION
from
plugin_dbui
import
CLEAN_SPACES
from
record
import
Record
...
...
@@ -376,10 +375,10 @@ class RecordPubli(Record):
for
di
in
dictionaries
:
if
isinstance
(
di
,
dict
):
if
"u"
in
di
:
continue
else
:
return
False
if
"u"
in
di
:
continue
else
:
return
False
else
:
return
False
...
...
modules/invenio_tools/recordthesis.py
View file @
172102fc
...
...
@@ -2,7 +2,7 @@
""" invenio_tools.recordthesis
"""
from
base
import
THESIS_DIR
from
base
import
REG_AUTHOR
,
THESIS_DIR
from
filters
import
CLEAN_THESIS_DEFENSE
from
recordpubli
import
RecordPubli
...
...
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