[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
BibFormat recap
- From: Ferran Jorba <Ferran.Jorba@xxxxxx>
- Subject: BibFormat recap
- Date: Thu, 01 Mar 2007 13:01:26 +0100
Hi all,
now that I've finished my conversion for our HTML detailed and HTML
brief formats in our test installation, I'd like to share some of my
conclusions.
First, the tool. I think that it is a good one. I like the
separation about the definition of a field (in Python) and the look of
the record (in XML). Personally, I haven't used the Web interface,
but rather in emacs, so I can version-control my files via quilt.
But the worst part has been debugging. If I make an error in Python,
the result is very hard to understand, at least at the beginning. For
example, if my error is in bfe_authors.py, the error message I get is:
Traceback (most recent call last):
File "testbibformat.py", line 81, in ?
test_bfo()
File "testbibformat.py", line 51, in test_bfo
authors = invenio.bibformat_elements.bfe_authors.format(bfo,'25')
AttributeError: 'module' object has no attribute 'bfe_authors'
I guess this is due to some kind of importing magic that I have seen
in the code (and I haven't tried to understand myself). But to
newcomers (and we are all newcomers at some time) it is extremely
disconcerting. I lost many yours modifying the __init__.py file,
etc. etc., importing the module explicitly (using the script in
http://cdsware.cern.ch/lists/project-cdsware-users/archive/msg00712.shtml)
until somehow I came with this conclusion. So now I know, and you too
:-)
The second issue is the default MARC21 values. Obviously CERN is
primarily interested in their records in their MARC21 dialect, but it
is not the official MARC21 format. Many fields are missing and some
others are understood differently.
I'm sure I have errors and missing elements, but to give you an idea
of the amount of modifications I had to do so it behaves in a more
official MARC21 way (and here there are some local files too):
etc/bibformat/format_templates/Default_HTML_brief.bft | 22 -
etc/bibformat/format_templates/Default_HTML_detailed.bft | 127 +++++++---
etc/bibformat/format_templates/Docemp_HTML_detailed.bft | 99 +++++++
etc/bibformat/format_templates/Examens_HTML_detailed.bft | 84 ++++++
lib/python/invenio/bibformat_elements/bfe_abstract.py | 99 ++-----
lib/python/invenio/bibformat_elements/bfe_authors.py | 46 ++-
lib/python/invenio/bibformat_elements/bfe_citation_references_note.py | 31 ++
lib/python/invenio/bibformat_elements/bfe_codi_assignatura.py | 43 +++
lib/python/invenio/bibformat_elements/bfe_dates_of_publication.py | 33 ++
lib/python/invenio/bibformat_elements/bfe_frequency.py | 40 +++
lib/python/invenio/bibformat_elements/bfe_fulltext.py | 47 ++-
lib/python/invenio/bibformat_elements/bfe_hierarchical_place_name.py | 42 +++
lib/python/invenio/bibformat_elements/bfe_holdings.py | 54 ++++
lib/python/invenio/bibformat_elements/bfe_host_item_entry.py | 68 +++++
lib/python/invenio/bibformat_elements/bfe_imprint.py | 49 ++-
lib/python/invenio/bibformat_elements/bfe_just_isbn.py | 29 ++
lib/python/invenio/bibformat_elements/bfe_just_issn.py | 29 ++
lib/python/invenio/bibformat_elements/bfe_keywords.py | 19 +
lib/python/invenio/bibformat_elements/bfe_notes.py | 39 ---
lib/python/invenio/bibformat_elements/bfe_physical_description.py | 72 +++++
lib/python/invenio/bibformat_elements/bfe_series.py | 67 +++++
lib/python/invenio/bibformat_elements/bfe_studies.py | 67 +++++
lib/python/invenio/bibformat_elements/bfe_title.py | 33 +-
lib/python/invenio/bibformat_elements/bfe_title_brief.py | 24 +
lib/python/invenio/bibformat_utils.py | 10
25 files changed, 1057 insertions(+), 216 deletions(-)
I'm willing to contribute this in any way, either publishing the
patches, the result files or whatever. But what I think would be more
useful is a global configuration variable to choose which kind of
MARC21 to use: LC 'official' or CERN-Swiss dialect. This way,
customisation would be just that, no a rewrite.
What do you think?
Ferran
|