[open-ils-commits] r163 - servres/trunk/conifer/syrup (gfawcett)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Mar 9 20:38:43 EDT 2009


Author: gfawcett
Date: 2009-03-09 20:38:42 -0400 (Mon, 09 Mar 2009)
New Revision: 163

Modified:
   servres/trunk/conifer/syrup/views.py
Log:
Graham's PyZ3950 dependency hack

So I can try out Art's demo code. Will work out the real dependency
problem later.


Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py	2009-03-09 23:49:36 UTC (rev 162)
+++ servres/trunk/conifer/syrup/views.py	2009-03-10 00:38:42 UTC (rev 163)
@@ -16,9 +16,25 @@
 from django.utils import simplejson
 import sys
 
+# Graham needs this import hackery to get PyZ3950 working. Presumably
+# Art can 'import profile', so this code won't run for him.
+
+try:
+    import profile
+    import lex
+    import yacc
+except ImportError:
+    sys.modules['profile'] = sys # just get something called profile;
+                                 # it's not actually used.
+    import ply.lex              
+    import ply.yacc             # pyz3950 thinks these are toplevel modules
+    sys.modules['lex'] = ply.lex
+    sys.modules['yacc'] = ply.yacc
+
 # for Z39.50 support, not sure whether this is the way to go yet but
 # as generic as it gets
-# from PyZ3950 import zoom
+from PyZ3950 import zoom
+
 #-----------------------------------------------------------------------------
 def log(level, msg):
     print >> sys.stderr, '[%s] %s: %s' % (datetime.now(), level.upper(), msg)



More information about the open-ils-commits mailing list