Re: format of citation keys

Peter Schulte-Stracke <mail-OvSX7JRiA6TkXZrADh/[email protected]>
Newsgroups gmane.comp.gnome.apps.pybliographer
Message-ID <1107195495l.1728l.0l@britten>
Am 31.01.2005 17:25:25 schrieb(en) Sie:
> hello dave
> 
> 
> this looks promising.
> 
> i did what you suggested. followingly, i created a new
> pybliographic database and importet a medline file. success ->  
> keys look nice now!
> 
> 
> however, my existing database are still with the old key
> format, and that is not changed. so i tried exporting the  
> database to medline format, and import it into a new database.  
> this gives the following error:
> [...]
>   File "/home/maasha/.pybrc.py", line 65, in generate_key_new2
>     key = 'entry-%d' % __entry
> NameError: global name '__entry' is not defined


>     if len (aut) == 0:
>         global __entry
>         key = 'entry-%d' % __entry
>         __entry = __entry + 1

You need to bind a number to __entry beforehand (beforeyou  
define the function):

__entry = 1

According to the Nutshell book, ""global"" should be the very  
first statement of the function.

Peter
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBB/nZnATdncJOcu2IRAiKrAJ9L2zXQIcy39KD2Li/9ZzHQSSAydwCg324A
aMYHe9k5WdLvGSP+3OvTxQ4=
=7Esx
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.