From fb0e45271444a756b9bb2af1aa8b7aca99c6d61d Mon Sep 17 00:00:00 2001 From: Art Rhyno Date: Wed, 12 Sep 2012 19:34:34 -0400 Subject: [PATCH] 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. --- conifer/syrup/views/unapi.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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) -- 2.11.0