(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
-------------------------
-# 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:
# 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'
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))