[open-ils-commits] r1087 - conifer/branches/rel_1_6_1/tools/ebooks (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Nov 25 10:59:21 EST 2010
Author: dbs
Date: 2010-11-25 10:59:19 -0500 (Thu, 25 Nov 2010)
New Revision: 1087
Modified:
conifer/branches/rel_1_6_1/tools/ebooks/prep_ebook_records.py
Log:
Create or extend the 040 according to MARC spec (040 = NR)
Also, don't identify OWA as a modifying source if they're not
part of the batch load.
Modified: conifer/branches/rel_1_6_1/tools/ebooks/prep_ebook_records.py
===================================================================
--- conifer/branches/rel_1_6_1/tools/ebooks/prep_ebook_records.py 2010-11-25 04:22:46 UTC (rev 1086)
+++ conifer/branches/rel_1_6_1/tools/ebooks/prep_ebook_records.py 2010-11-25 15:59:19 UTC (rev 1087)
@@ -245,13 +245,29 @@
)
new_record.add_field(note)
+ add_cat_source(new_record, options)
+
+ writer.write(new_record)
+
+def add_cat_source(record, options):
+ """Add or extend the 040 field to identify the cataloguing source"""
+
+ # Only Windsor wants to do this
+ if 'windsor' not in options['libraries']:
+ return
+
+ cat_source = record['040']
+ if cat_source:
+ # Add subfield 'd' identifying Windsor
+ cat_source.add_subfield('d', 'CaOWA')
+ else:
+ # Add a 040 with subfield 'd' identifying Windsor
forty = pymarc.Field(tag = '040',
indicators = [' ', ' '],
- subfields = [ 'a', 'CaOWA' ]
+ subfields = [ 'd', 'CaOWA' ]
)
- new_record.add_field(forty)
+ record.add_field(forty)
- writer.write(new_record)
def process_urls(field, options):
"""Creates 856 fields required by Conifer"""
More information about the open-ils-commits
mailing list