Include an ISBN in the error log if available
authorDan Scott <dan@coffeecode.net>
Wed, 20 Jul 2011 16:10:21 +0000 (12:10 -0400)
committerDan Scott <dscott@laurentian.ca>
Tue, 7 May 2013 18:36:29 +0000 (14:36 -0400)
This should help with identifying problem records.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
tools/ebooks/prep_ebook_records.py

index b79452a..efe34d9 100644 (file)
@@ -326,9 +326,15 @@ def process_fields(record, options):
             new_record.add_field(field)
 
     if not marked_isbn:
-        print("No matching ISBN target found in SFX for %s" %
-            (new_record['856']['u'])
-        )
+        try:
+            isbn = record['020']['a']
+            print("ISBN: [%s] - no matching ISBN target found in SFX for %s" %
+                (isbn, new_record['856']['u'])
+            )
+        except:
+            print("No matching ISBN target found in SFX for %s" %
+                (new_record['856']['u'])
+            )
 
     return new_record