From: Art Rhyno Date: Wed, 22 Jun 2011 00:13:28 +0000 (-0400) Subject: Moving more site-specific settings into local_settings. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7d626a65e13815d5a2611e683c1920d17ed7e3a7;p=syrup%2Fmasslnc.git Moving more site-specific settings into local_settings. Signed-off-by: Art Rhyno --- diff --git a/conifer/integration/evergreen_site.py b/conifer/integration/evergreen_site.py index 0d030de..32f6e76 100644 --- a/conifer/integration/evergreen_site.py +++ b/conifer/integration/evergreen_site.py @@ -105,13 +105,13 @@ class EvergreenIntegration(object): USE_Z3950 = bool(getattr(settings, 'Z3950_CONFIG', None)) - TIME_FORMAT = "%Y-%m-%dT%H:%M:%S" - DUE_FORMAT = "%b %d %Y, %r" + TIME_FORMAT = getattr(settings, 'SYRUP_TIME_FORMAT', '%Y-%m-%dT%H:%M:%S') + DUE_FORMAT = getattr(settings, 'SYRUP_DUE_FORMAT', '%b %d %Y, %r') # regular expression to detect DVD, CD, CD-ROM, Guide, Booklet on the end of a # call number - IS_ATTACHMENT = re.compile('\w*DVD\s?|\w*CD\s?|\w[Gg]uide\s?|\w[Bb]ooklet\s?|\w*CD\-ROM\s?') - + ATTACHMENT_EXPRESSION = getattr(settings, 'ATTACHMENT_REGEXP', '\w*DVD\s?|\w*CD\s?|\w[Gg]uide\s?|\w[Bb]ooklet\s?|\w*CD\-ROM\s?') + IS_ATTACHMENT = re.compile(ATTACHMENT_EXPRESSION) # Used if you're doing updates to Evergreen from Syrup. diff --git a/conifer/integration/uwindsor.py b/conifer/integration/uwindsor.py index e4f0511..982b5c9 100644 --- a/conifer/integration/uwindsor.py +++ b/conifer/integration/uwindsor.py @@ -16,7 +16,6 @@ class UWindsorIntegration(EvergreenIntegration): OPAC_LANG = 'en-CA' OPAC_SKIN = 'uwin' - RESERVES_DESK_NAME = 'Leddy: Course Reserves - Main Bldng - 1st Flr - Reserve Counter at Circulation Desk' SITE_DEFAULT_ACCESS_LEVEL = 'RESTR' # Options for circ modifiers @@ -31,7 +30,7 @@ class UWindsorIntegration(EvergreenIntegration): # TODO: these are harcoded for now, should make the opensrf calls to resolve them # Options for circ desk DESK_CHOICES = [ - ('631', 'Reserves Counter'), + ('821', 'Reserves Counter'), ('598', 'Circulating Collection'), ] diff --git a/conifer/libsystems/evergreen/support.py b/conifer/libsystems/evergreen/support.py index a81c060..d727ad5 100644 --- a/conifer/libsystems/evergreen/support.py +++ b/conifer/libsystems/evergreen/support.py @@ -56,13 +56,13 @@ def evergreen_request(method, *args, **kwargs): params = ['%s=%s' % (k,quote(v)) for k,v in kwargs.items()] params += ['param=%s' % quote(json.dumps(a)) for a in args] url = '%s?%s' % (GATE, '&'.join(params)) # fixme, OSRF_HTTP, IDL_URL - #print '--->', url + # print '--->', url req = urllib2.urlopen(url) resp = json.load(req) if resp['status'] != 200: raise Exception('error during evergren request', resp) payload = resp['payload'] - #print '<---', payload + # print '<---', payload return evergreen_object(payload) def evergreen_request_single_result(method, *args, **kwargs): diff --git a/conifer/local_settings.py.example b/conifer/local_settings.py.example index a1053a0..d6f2421 100644 --- a/conifer/local_settings.py.example +++ b/conifer/local_settings.py.example @@ -51,6 +51,10 @@ CAS_AUTHENTICATION = False CAS_SERVER_URL = 'https://uwinid.uwindsor.ca/cas/' EVERGREEN_SERVER = 'www.concat.ca' +RESERVES_DESK_NAME = 'Leddy: Course Reserves - Main Bldng - 1st Flr - Reserve Counter at Circulation Desk' +SYRUP_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S' +SYRUP_DUE_FORMAT = '%b %d %Y, %r' +ATTACHMENT_REGEXP ='\w*DVD\s?|\w*CD\s?|\w[Gg]uide\s?|\w[Bb]ooklet\s?|\w*CD\-ROM\s?' # Note, in the Evergreen integration, commenting out Z3950_CONFIG or setting it # equal to None will result in OpenSRF being used for catalogue search instead