improve setup and debug lucene calls
authorymh <ymh.work@gmail.com>
Tue, 03 May 2011 17:20:47 +0200
changeset 84 91a4dafd5904
parent 83 b7aef101c7d1
child 85 7c087e4b154f
improve setup and debug lucene calls
src/ldt/ldt/indexation/__init__.py
src/ldt/setup.py
--- a/src/ldt/ldt/indexation/__init__.py	Tue May 03 17:17:17 2011 +0200
+++ b/src/ldt/ldt/indexation/__init__.py	Tue May 03 17:20:47 2011 +0200
@@ -11,5 +11,6 @@
 ANALYZER.addAnalyzer("all", lucene.FrenchAnalyzer(lucene.Version.LUCENE_CURRENT))
 
 def get_writer():
+    lucene.getVMEnv().attachCurrentThread()
     return lucene.IndexWriter(STORE, ANALYZER, True, lucene.IndexWriter.MaxFieldLength.UNLIMITED)
 
--- a/src/ldt/setup.py	Tue May 03 17:17:17 2011 +0200
+++ b/src/ldt/setup.py	Tue May 03 17:20:47 2011 +0200
@@ -8,7 +8,13 @@
 ROOT_DIR = os.path.dirname(__file__)
 SOURCE_DIR = os.path.join(ROOT_DIR, 'ldt')
 
-version = __import__('ldt').__version__
+version_variables = {}
+try:
+    execfile(os.path.join(SOURCE_DIR, "__init__.py"), version_variables)
+except:
+    pass
+
+version = version_variables['__version__']
 
 def fullsplit(path, result=None):
     """