commit 99ea22f7293b5b324b3a715f0a7a4eb243c709b0
parent 02825e3d48ee57ff70e101c497663ff9362b631f
Author: Christian Grothoff <christian@grothoff.org>
Date: Fri, 6 May 2005 10:39:09 +0000
up
Diffstat:
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/main/Extractor.py b/src/main/Extractor.py
@@ -16,19 +16,19 @@ class Extractor(object):
"""
def __init__(self):
- self.plugins = _extractor.loadDefaultLibraries()
+ self.__plugins = _extractor.loadDefaultLibraries()
def __del__(self):
- _extractor.removeAll(self.plugins)
+ _extractor.removeAll(self.__plugins)
# def load(plugs):
-# self.plugins = _extractor.load(self.plugins, plugs)
+# self.__plugins = _extractor.load(self.__plugins, plugs)
# return None
# def unload(plugs):
-# self.plugins = _extractor.unload(self.plugins, plugs)
+# self.__plugins = _extractor.unload(self.__plugins, plugs)
# return None
def extract(self,filename):
"""Pass a filename to extract keywords.
"""
- return _extractor.extract(self.plugins, filename, Keyword)
+ return _extractor.extract(self.__plugins, filename, Keyword)
class Keyword(object):
def __init__(self,type,value):
diff --git a/src/main/libextractor_python.c b/src/main/libextractor_python.c
@@ -65,8 +65,12 @@ static PyObject * EXTRACTOR_PY_extract(PyObject * self,
&filename,
&py_clzz);
ex = PyCObject_AsVoidPtr(py_exts);
+
+ Py_BEGIN_ALLOW_THREADS;
keys = EXTRACTOR_getKeywords(ex,
filename);
+ Py_END_ALLOW_THREADS;
+
ret = PyList_New(0);
pos = keys;
while (pos != NULL) {