#719: BibClassify: rdflib should be optional dependency
--------------------------+----------------------
Reporter: simko | Owner: rchyla
Type: defect | Status: assigned
Priority: major | Milestone: v1.0
Component: BibClassify | Version:
Resolution: | Keywords:
--------------------------+----------------------
Changes (by simko):
* status: in_merge => assigned
Comment:
Thanks, that's better, but when one runs bibclassify, one still gets a
traceback like:
{{{
Traceback (most recent call last):
File "/opt/invenio/bin/bibclassify", line 62, in <module>
main()
File "/usr/local/lib/python2.6/dist-
packages/invenio/bibclassify_cli.py", line 117, in main
only_core_tags=options["only_core_tags"])
File "/usr/local/lib/python2.6/dist-
packages/invenio/bibclassify_engine.py", line 111, in
output_keywords_for_sources
process_lines()
File "/usr/local/lib/python2.6/dist-
packages/invenio/bibclassify_engine.py", line 90, in process_lines
extract_acronyms=extract_acronyms
File "/usr/local/lib/python2.6/dist-
packages/invenio/bibclassify_engine.py", line 175, in
get_keywords_from_text
rebuild=rebuild_cache, no_cache=no_cache))
File "/usr/local/lib/python2.6/dist-
packages/invenio/bibclassify_ontology_reader.py", line 172, in
get_regular_expressions
return _build_cache(onto_path, skip_cache=no_cache)
File "/usr/local/lib/python2.6/dist-
packages/invenio/bibclassify_ontology_reader.py", line 552, in
_build_cache
except rdflib.exceptions.Error, e:
AttributeError: 'NoneType' object has no attribute 'exceptions'
}}}
It would be better to emit some nice message saying something like "You
have to install python-rdflib dependency in order to run bibclassify.
Please see the INSTALL file for more information."
(BTW, other modules use variables named like `PSYCO_AVAILABLE`,
`simplejson_available` to detect dependencies, so for overall consistency
across modules, you may want to use `RDFLIB_AVAILABLE` instead of setting
`rdflib = None` when this module is not available.)
--
Ticket URL: <http://invenio-software.org/ticket/719#comment:2>
Invenio <http://invenio-software.org>