pybliographer r1286 - trunk/Pyblio/Format
- From: fredgo svn gnome org
- To: svn-commits-list gnome org
- Subject: pybliographer r1286 - trunk/Pyblio/Format
- Date: Sun, 30 Nov 2008 14:13:42 +0000 (UTC)
Author: fredgo
Date: Sun Nov 30 14:13:41 2008
New Revision: 1286
URL: http://svn.gnome.org/viewvc/pybliographer?rev=1286&view=rev
Log:
Revision: gobry pybliographer org--2007/pyblio--stable--1.2--patch-26
Creator: Frederic Gobry <gobry pybliographer org>
fixed import/export script
Fixed the Ovid writer to reformat initials properly before outputting them.
Modified:
trunk/Pyblio/Format/OvidLike.py
trunk/Pyblio/Format/ut_Ovidlike.py
Modified: trunk/Pyblio/Format/OvidLike.py
==============================================================================
--- trunk/Pyblio/Format/OvidLike.py (original)
+++ trunk/Pyblio/Format/OvidLike.py Sun Nov 30 14:13:41 2008
@@ -268,6 +268,7 @@
output.write ('<%d>\n' % counter)
keys = entry.keys()
+ keys.sort()
write_source_field (output, entry, keys)
@@ -312,12 +313,18 @@
output.write('\n')
-def write_author_field (output, value):
- auths = [ '%s %s' % (auth.last or '', auth.first or '')
- for auth in value]
- output.write (' ')
- output.write (' '.join (auths))
- output.write ('\n')
+def write_author_field(output, value):
+ # Initials are grouped together in Ovid (ie I. E. becomes IE.)
+ auths = []
+ for auth in auths:
+ parts = [auth.last]
+ if auth.first:
+ parts.append(''.join(word[0].upper()
+ for word in auth.first.split(' ')) + '.')
+ auths.append(' '.join(parts))
+ output.write(' ')
+ output.write(' '.join (auths))
+ output.write('\n')
def write_source_field (output, entry, keys):
Modified: trunk/Pyblio/Format/ut_Ovidlike.py
==============================================================================
--- trunk/Pyblio/Format/ut_Ovidlike.py (original)
+++ trunk/Pyblio/Format/ut_Ovidlike.py Sun Nov 30 14:13:41 2008
@@ -1,4 +1,4 @@
-# -*- coding: 'iso8859-1' -*-
+# -*- coding: iso-8859-1 -*-
data = ["""Authors
Muller S. Garda P. Muller JD. Cansi Y.
Title
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]