From: Art Rhyno Date: Mon, 28 May 2012 01:01:26 +0000 (-0400) Subject: slight changes for windows support X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4493e4f71185373274d1f1b275b6c171eeafe400;p=syrup%2Fmasslnc.git slight changes for windows support --- diff --git a/conifer/README b/conifer/README index cc8859a..9c55fc9 100644 --- a/conifer/README +++ b/conifer/README @@ -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 ------------------------- diff --git a/conifer/libsystems/z3950/pyz3950_search.py b/conifer/libsystems/z3950/pyz3950_search.py index d77a4f9..7e8dc6b 100644 --- a/conifer/libsystems/z3950/pyz3950_search.py +++ b/conifer/libsystems/z3950/pyz3950_search.py @@ -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))