From 4e5abf20436100ac7ef4a499227906073ebdf60c Mon Sep 17 00:00:00 2001 From: artunit Date: Wed, 19 Jan 2011 17:11:03 +0000 Subject: [PATCH] better attachment handling, need to test more before production git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@1205 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- conifer/integration/uwindsor.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/conifer/integration/uwindsor.py b/conifer/integration/uwindsor.py index fcb1ecc..6ed2023 100644 --- a/conifer/integration/uwindsor.py +++ b/conifer/integration/uwindsor.py @@ -24,7 +24,9 @@ DUE_FORMAT = "%b %d %Y, %r" OPENSRF_CN_CALL = "open-ils.search.asset.copy.retrieve_by_cn_label" OPENSRF_FLESHED2_CALL = "open-ils.search.asset.copy.fleshed2.retrieve" OPENSRF_COPY_COUNTS = "open-ils.search.biblio.copy_counts.location.summary.retrieve" -ATTACHMENT = 'DVD' + +#setup for DVD, CD, CD-ROM, Guide, Booklet on the end of a call number +ATTACHMENT = '\w*DVD\s?|\w*CD\s?|\w[Gg]uide\s?|\w[Bb]ooklet\s?|\w*CD\-ROM\s?' # USE_Z3950: if True, use Z39.50 for catalogue search; if False, use OpenSRF. # Don't set this value directly here: rather, if there is a valid Z3950_CONFIG @@ -120,13 +122,11 @@ def _item_status(bib_id): volume check - based on v.1, etc. in call number """ voltest = re.search(r'\w*v\.\s?(\d+)', callnum) + """ - attachment test - will need to sort out if this applies to more than DVDs + attachment test """ - attachtest = False - if callno.find(ATTACHMENT) == -1: - #make this funkier if there is a possibility of more than one type - attachtest = callnum.endswith(ATTACHMENT) + attachtest = re.search(ATTACHMENT, callnum) if loc == RESERVES_DESK_NAME: desk += anystatus_here @@ -136,7 +136,7 @@ def _item_status(bib_id): callsuffix = "/" + callnum else: callprefix = callnum + "/" - elif attachtest: + elif attachtest and callno.find(attachtest.group(0)) == -1: if len(callno) > 0: callsuffix = "/" + callnum else: -- 2.11.0