[open-ils-commits] r243 - servres/trunk/conifer/syrup (artunit)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Apr 2 00:15:49 EDT 2009


Author: artunit
Date: 2009-04-02 00:15:47 -0400 (Thu, 02 Apr 2009)
New Revision: 243

Modified:
   servres/trunk/conifer/syrup/views.py
Log:


Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py	2009-04-02 01:34:25 UTC (rev 242)
+++ servres/trunk/conifer/syrup/views.py	2009-04-02 04:15:47 UTC (rev 243)
@@ -233,24 +233,31 @@
 def z3950_test(request):
     #testing JZKitZ3950 - it seems to work, but i have a character set problem
     #with the returned marc
+    #nope - the problem is weak mapping with the limited solr test set
+    #i think this can be sorted out
 
     #conn = zoom.Connection ('z3950.loc.gov', 7090)
     #conn = zoom.Connection ('webvoy.uwindsor.ca', 9000)
     #solr index with JZKitZ3950 wrapping
     conn = zoom.Connection ('127.0.0.1', 2100)
+    # conn = zoom.Connection ('127.0.0.1', 2100)
     print("connecting...")
     conn.databaseName = 'Test'
+    # conn.preferredRecordSyntax = 'XML'
     conn.preferredRecordSyntax = 'USMARC'
     query = zoom.Query ('CCL', 'ti="agar"')
     res = conn.search (query)
-    print(len(res))
     collector = []
+    # if we wanted to get into funkiness
+    m = zmarc.MARC8_to_Unicode ()
     for r in res:
-        #this hits the marc problem - need to figure out how to set strict
-        print(str(r))
-        collector.append(str(r))
+        print(type(r.data))
+        print(type(m.translate(r.data)))
+        rec = zmarc.MARC (r.data, strict=0)
+        # rec = zmarc.MARC (rec, strict=0)
+        collector.append(str(rec))
+
     conn.close ()
-
     res_str = "" . join(collector)
     return g.render('z3950_test.xhtml', res_str=res_str)
 



More information about the open-ils-commits mailing list