From: Art Rhyno Date: Wed, 12 Sep 2012 23:34:34 +0000 (-0400) Subject: Modify unapi layer for apache X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fb0e45271444a756b9bb2af1aa8b7aca99c6d61d;p=syrup%2Fmasslnc.git Modify unapi layer for apache This does not happen in all environments, but apache seems to get hung on the initialization work for unapi. For now, this has been moved into the unapi call proper. --- diff --git a/conifer/syrup/views/unapi.py b/conifer/syrup/views/unapi.py index 56c84cc..faaee68 100644 --- a/conifer/syrup/views/unapi.py +++ b/conifer/syrup/views/unapi.py @@ -2,12 +2,15 @@ from lxml import etree from _common import * -stylesheet = etree.parse( - file(HERE('templates/unapi/MARC21slim2MODS3-3.xsl'))) +def unapi(request): + #sometimes apache does not seem to like doing this as part of the + #import step in __init__.py, and will hang on the request, so we + #do this each time + stylesheet = etree.parse( + file(HERE('templates/unapi/MARC21slim2MODS3-3.xsl'))) -xform = etree.XSLT(stylesheet) + xform = etree.XSLT(stylesheet) -def unapi(request): id = request.GET.get('id') if not id: return g.render_xml('unapi/formats.xml', item=None)