slight changes for windows support
authorArt Rhyno <art632000@yahoo.ca>
Mon, 28 May 2012 01:01:26 +0000 (21:01 -0400)
committerArt Rhyno <art632000@yahoo.ca>
Mon, 28 May 2012 01:01:26 +0000 (21:01 -0400)
conifer/README
conifer/libsystems/z3950/pyz3950_search.py

index cc8859a..9c55fc9 100644 (file)
@@ -33,9 +33,10 @@ Third-party Python dependencies:
 
 (You'll need 'setuptools' in order to have 'easy_install'.)
 
-Windows is very similar, see:
+Windows is very similar, use setuptools. The trickiest dependency might
+be lxml, it is possible to get a binary for it here:
 
-http://groups.google.com/group/syrup-reserves-discuss/web/installing-syrup-in-windows
+http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
 
 Getting this thing to run
 -------------------------
index d77a4f9..7e8dc6b 100644 (file)
@@ -1,13 +1,8 @@
-# z39.50 search using yaz-client. 
-# dependencies: yaz-client, pexpect
-
-# I found that pyz3950.zoom seemed wonky when testing against conifer
-# z3950, so I whipped up this expect-based version instead.
+# use pyz3950 for z39.50 goodness
 
 import warnings
 import re
 import sys
-from ..marcxml import marcxml_to_dictionary
 from xml.etree import ElementTree as ET
 
 try:
@@ -28,16 +23,12 @@ except ImportError:
 # as generic as it gets
 from PyZ3950 import zoom, zmarc
 
-
-LOG = None              #  for pexpect debugging, try LOG = sys.stderr
+LOG = None              
 GENERAL_TIMEOUT = 40
 PRESENT_TIMEOUT = 60
 
 def search(host, port, database, query, start=1, limit=10):
 
-
-    query = query.encode('utf-8') # is this okay? Is it enough??
-
     conn = zoom.Connection(host, port)
     conn.databaseName = database
     conn.preferredRecordSyntax = 'XML'
@@ -89,8 +80,8 @@ def search(host, port, database, query, start=1, limit=10):
 
 if __name__ == '__main__':
     tests = [
-        ('zed.concat.ca:210', 'OSUL', 'chanson'),
+        ('zed.concat.ca', 210, 'OSUL', 'chanson'),
         ]
-    for host, db, query in tests:
-        print (host, db, query)
-        print len(search(host, db, query, limit=33))
+    for host, port, db, query in tests:
+        print (host, port, db, query)
+        print len(search(host, port, db, query, limit=10))