|
List Info
Thread: Re: Cherrypy and PyLucene
|
|
| Re: Cherrypy and PyLucene |

|
2007-12-18 04:19:16 |
|
ok, the threading code is added to the tools wiki
Marc Jeurissen University of Antwerp Library automation
On Dec 13, 2007 6:27 PM, Robert Brewer < fumanchu  aminus.org ">
fumanchu aminus.org> wrote:
marc.jeuri ssen gmail.com">
marc.jeurissen gmail.com wrote: > As described in the tools wiki (http://tools.cherrypy.org/wiki/ > PyLucene) there is a problem in using PyLucene from CherryPy since
> PyLucene uses a slightly different Thread class > (PyLucene.PythonThread). The wiki suggests to modify the CherryPy > source code. > > Here I propose a solution to avoid this (inspired by the
> dummy_threading module mentioned to me by my colleague Richard > Philips). > Import the following code on top of your application, before you > import cherrypy. All subsequent 'import threading' commands will
> import this module and use the PyLucene.PythonThread class. > Be sure to replace the 'anet.explorator.exploratorthreading9; path by > the name and path you give to the module. > It is necessary to fill the locals() table with the _names of the
> threading module since CherryPy addresses some _classes directly > (_Timer for example) > > > exploratorthreading.py: > > > from threading import * > from threading import __all__
> > import threading > all = dir(threading) > for name in all: > if name[0] == '_'; and name[1] != '_';: > locals()[name] = eval('threading.%s' % name)
> > import sys > del sys.modules['threading'] > > try: > sys.modules['threading'] = > sys.modules['anet.explorator.exploratorthreading39;] > except:
> sys.modules['threading'] = sys.modules['exploratorthreading'] > > import PyLucene > class Thread(PyLucene.PythonThread): > def __init__(self, *args, **kwds): >
PyLucene.PythonThread.__init__(self,*args, **kwds)
Thanks, Marc! The tools wiki is open to all, so feel free to paste this directly into
http://tools.cherrypy.org/wiki/PyLucene
Robert Brewer fumanchu aminus.org">fumanchu aminus.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group. To post to this group, send email to cherrypy-users googlegroups.com To unsubscribe from this group, send email to cherrypy-users-unsubscribe googlegroups.com For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en -~----------~----~----~----~------~----~------~--~---
|
[1]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|