[Rivet-svn] r3946 - branches/2012-06-aidarivet/bin trunk/bin

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Oct 2 15:16:42 BST 2012


Author: hoeth
Date: Tue Oct  2 15:16:41 2012
New Revision: 3946

Log:
include bibtex id in rivet-findid output

Modified:
   branches/2012-06-aidarivet/bin/rivet-findid
   trunk/bin/rivet-findid

Modified: branches/2012-06-aidarivet/bin/rivet-findid
==============================================================================
--- branches/2012-06-aidarivet/bin/rivet-findid	Tue Oct  2 15:03:18 2012	(r3945)
+++ branches/2012-06-aidarivet/bin/rivet-findid	Tue Oct  2 15:16:41 2012	(r3946)
@@ -104,6 +104,10 @@
         print 'inspire     %s' % insp
         print 'inspire_url http://inspirehep.net/record/%s' % insp
 
+    tex = result.get('bibtex')
+    if tex:
+        print 'bibtex      %s' % tex
+
     riv = result.get('rivet')
     if riv:
         print 'rivet       %s' % riv
@@ -159,6 +163,15 @@
 
     for i in tree.getiterator('{http://www.loc.gov/MARC21/slim}datafield'):
 
+        if i.get('tag') == '035':
+            entries = {}
+            for c in i.getchildren():
+                for k,v in c.items():
+                    if k=='code':
+                        entries[v] = c.text
+            if entries.get('9') == 'SPIRESTeX':
+                result['bibtex'] = entries['z']
+
         if i.get('tag') == '037':
             entries = {}
             for c in i.getchildren():

Modified: trunk/bin/rivet-findid
==============================================================================
--- trunk/bin/rivet-findid	Tue Oct  2 15:03:18 2012	(r3945)
+++ trunk/bin/rivet-findid	Tue Oct  2 15:16:41 2012	(r3946)
@@ -104,6 +104,10 @@
         print 'inspire     %s' % insp
         print 'inspire_url http://inspirehep.net/record/%s' % insp
 
+    tex = result.get('bibtex')
+    if tex:
+        print 'bibtex      %s' % tex
+
     riv = result.get('rivet')
     if riv:
         print 'rivet       %s' % riv
@@ -159,6 +163,15 @@
 
     for i in tree.getiterator('{http://www.loc.gov/MARC21/slim}datafield'):
 
+        if i.get('tag') == '035':
+            entries = {}
+            for c in i.getchildren():
+                for k,v in c.items():
+                    if k=='code':
+                        entries[v] = c.text
+            if entries.get('9') == 'SPIRESTeX':
+                result['bibtex'] = entries['z']
+
         if i.get('tag') == '037':
             entries = {}
             for c in i.getchildren():


More information about the Rivet-svn mailing list