[open-ils-commits] r1205 - servres/trunk/conifer/integration (artunit)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jan 19 12:11:06 EST 2011


Author: artunit
Date: 2011-01-19 12:11:03 -0500 (Wed, 19 Jan 2011)
New Revision: 1205

Modified:
   servres/trunk/conifer/integration/uwindsor.py
Log:
better attachment handling, need to test more before production

Modified: servres/trunk/conifer/integration/uwindsor.py
===================================================================
--- servres/trunk/conifer/integration/uwindsor.py	2011-01-19 05:18:49 UTC (rev 1204)
+++ servres/trunk/conifer/integration/uwindsor.py	2011-01-19 17:11:03 UTC (rev 1205)
@@ -24,8 +24,10 @@
 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
 # settings in local_settings.py, then Z39.50 will be used.
@@ -120,13 +122,11 @@
 		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 @@
 				callsuffix = "/" + callnum
 			else:
 				callprefix = callnum + "/" 
-		    elif attachtest:
+		    elif attachtest and callno.find(attachtest.group(0)) == -1:
 			if len(callno) > 0:
 				callsuffix = "/" + callnum
 			else:



More information about the open-ils-commits mailing list