Re: pybliographer example and custom bibtex fields

"Frédéric Gobry" <[email protected]> Fri, 9 Mar 2007 20:54:54 +0000
Newsgroups gmane.comp.gnome.apps.pybliographer
Message-ID <[email protected]>
> Finally I got into trying devel branch ;-) I've got 1.3.2 shipped in
> debian experimental (thanks Chris Lawrence for packaging). I am after a

Coool :)

> As a first attempt I've tried an example: bibtex2bip.py and failed even
> to read (parse) the file I fed to it:

As you noticed, the parser is quite strict by default... Below I'll
explain you how to fix your issue.

One note of caution regarding 1.3 as a way to massage bibtex files:
there is a different assumption in the data models of 1.2 and 1.3,
which I should probably make clearer upfront in the documentation. 1.2
was meant to manipulate bibtex files, and as such, tried its best to
keep these files in the same state as it found them (keeping @strings
for instance). 1.3 is mean to manipulate bibliogaphic data in a more
general sense, and in the case of @string entries, it is not yet able
to maintain them properly. So if your file uses such features, you
might not get what you want.

>
> ,----
> | $> python /usr/share/doc/pybliographer/examples/bibtex2bip.py  fmridiff=
.bib fmridiff_out.bib    Traceback (most recent call last):
> |   File "/usr/share/doc/pybliographer/examples/bibtex2bip.py", line 32, =
in ?
> |     reader.parse(fd, db)
> |   File "/var/lib/python-support/python2.4/Pyblio/Parsers/Syntax/BibTeX/=
__init__.py", line 390, in parse
> |     self.record_parse (data)
> |   File "/var/lib/python-support/python2.4/Pyblio/Parsers/Syntax/BibTeX/=
__init__.py", line 360, in record_parse
> |     self.record_dispatch (k.lower (), v)
> |   File "/var/lib/python-support/python2.4/Pyblio/Parsers/Syntax/BibTeX/=
__init__.py", line 337, in record_dispatch
> |     raise Exceptions.SchemaError (
> | Pyblio.Exceptions.SchemaError: no attribute 'authoraddress' in document=
 'Article'
> `---
>
> is there a quick solution such as to allow custom fields?

I don't have a bibtex bible at hand, but if authoraddress is a
standard field, I suggest you add it to the bibtex schema
(Pyblio/RIP/bibtex.sip). Otherwise, the correct way is to create your
own schema and use that one instead.

-- =

Fr=E9d=E9ric

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE=
VDEV