Re: changing default key for pybliographer
Yaroslav Halchenko <[email protected]>
| Newsgroups | gmane.comp.gnome.apps.pybliographer |
|---|---|
| Message-ID | <[email protected]> |
*ravana[0] ~>grep '~' /usr/bin/pybliographer
sources.append (os.path.expanduser('~/.pybrc.py'))
So I believe you can (re)define some functionality there... but the
developers should know better about hooks for userdefined code
On Fri, Oct 22, 2004 at 01:43:38PM -0700, Scott Webster wrote:
> Interesting... I thought of writing something like this myself
> (currently I just manually enter each Key).
> It would be nice if this was possible without editing the system wide
> pybliographer files though. I guess I could just install everything
> in my home directory and edit it there, but that's kindof a pain. Is
> there some other way to do this?
> Thanks,
> Scott
> On Fri, 22 Oct 2004 15:45:17 +0100, david.evans-I9fZos/[email protected]
> <david.evans-I9fZos/[email protected]> wrote:
> > Hi,
> > I did something similar by writing a new function in Utils.py. Mine
> > makes AuthorBCDYY,
> > where Author is the surname of the first author, B,C,D are the first
> > letters of the surnames of subsequent authors, and YY is the year.
> > It's probably an ugly hack by the standards of the developers, but it
> > works for me :)
> > Dave
> > def generate_key_new (entry, table):
> > if entry.has_key ('author'): aut = entry ['author']
> > elif entry.has_key ('editor'): aut = entry ['editor']
> > else: aut = ()
> > if len (aut) == 0:
> > global __entry
> > key = 'entry-%d' % __entry
> > __entry = __entry + 1
> > else:
> > honorific, first, last, lineage = aut [0].format ()
> > key = join (split (last, ' '), '')
> > nextkey = ''
> > if len (aut) > 1:
> > for a in aut:
> > honorific, first, last, lineage = a.format ()
> > nextkey = nextkey + join (map (lambda x:
> > x [0], split (last, ' ')), '')
> > nextkey = str (nextkey) [1:]
> > key = key + join (nextkey, '')
> > if entry.has_key ('date'):
> > year = entry ['date'].year
> > if year: key = key + str (year) [2:]
> > base = _flat (key)
> > key = Key.Key (table, base)
> > if table.has_key (key):
> > suff = ord ('a')
> > while table.has_key (key):
> > suff = suff + 1
> > if suff > ord ('z'):
> > suff = ord ('a')
> > base = base + 'a'
> > key = Key.Key (table, base + chr (suff))
> > return Key.Key (table, key)
> > Autoload.register ('key', 'New', generate_key_new)
> > ---- Message from "Vitaly V. Ganusov" <[email protected]> at
> > 2004-10-22 09:53:34 ------
> > >Hi,
> > >I'm intensively using pybliographer (gui version) to keep my library
> > in
> > >the bibtex format. One feature that I would like to change is the
> > >default way of creating a key for each new entry. Currently,
> > >pybliographer creates the key taking one letter of last names of 3
> > first
> > >authors of the entry plus year and plus additional letters (a,b,c,
> > etc)
> > >if such entry already is present. I would like to have it such as
> > the
> > >key is the complete last name of the first author plus the year of
> > >publication (last two digits - as it is currently) and adding a,b,c
> > >(etc) if needed at the end.
> > >Do you know if this can be done by changing configuration files or
> > >somehow else?
> > >help is greatly appreciated
> > >Vitaly
> > >--
> > >Vitaly V. Ganusov
> > >Population Biology, Ecology and Evolution Program
> > >Biology department
> > >Emory University
> > >Atlanta, GA 30322
> > >USA
> > >ph : +1 404-727-1765
> > >fax: +1 404-727-2880
> > >http://userwww.service.emory.edu/~vganuso/
> > >-------------------------------------------------------
> > >This SF.net email is sponsored by: IT Product Guide on
> > ITManagersJournal
> > >Use IT products in your business? Tell us what you think of them.
> > Give us
> > >Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find
> > out more
> > >http://productguide.itmanagersjournal.com/guidepromo.tmpl
> > >_______________________________________________
> > >Pybliographer-general mailing list
> > >Pybliographer-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> > >https://lists.sourceforge.net/lists/listinfo/pybliographer-general
> > -------------------------------------------------------
> > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> > Use IT products in your business? Tell us what you think of them. Give us
> > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> > http://productguide.itmanagersjournal.com/guidepromo.tmpl
> > _______________________________________________
> > Pybliographer-general mailing list
> > Pybliographer-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> > https://lists.sourceforge.net/lists/listinfo/pybliographer-general
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> Pybliographer-general mailing list
> Pybliographer-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/pybliographer-general
--
.-.
=------------------------------ /v\ ----------------------------=
Keep in touch // \\ (yoh@|www.)onerussian.com
Yaroslav Halchenko /( )\ ICQ#: 60653192
Linux User ^^-^^ [175555]
Key http://www.onerussian.com/gpg-yoh.asc
GPG fingerprint 3BB6 E124 0643 A615 6F00 6854 8D11 4563 75C0 24C8
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFBeYJejRFFY3XAJMgRArbMAJ9oo84gzNQoO6IueIrRZsbj27VZHwCfSrnC 4NUP4c3osDdSk2OFEdYqydc= =JHUk -----END PGP SIGNATURE-----