Skip to content
Snippets Groups Projects

Draft: New plugin: LDAP Search

Open Tom Shnayder requested to merge toms/gajim-plugins:ldap into master
@@ -32,6 +32,12 @@ class LdapSearcher:
def start(self):
assert not self._thread
self._stop.clear()
self._conn = None
self._rebind = True
self._error = None
self._thread = threading.Thread(target=self._worker)
self._thread.daemon = True
self._thread.start()
@@ -42,6 +48,8 @@ class LdapSearcher:
self._thread = None
def _worker(self):
log.info('Worker thread started')
while not self._stop.is_set():
try:
search_filter, attributes, on_result, on_error = self._request_queue.get(timeout=0.1)
@@ -72,6 +80,9 @@ class LdapSearcher:
if on_error:
on_error(error_message)
self._unbind()
log.info('Worker thread stopped')
@staticmethod
def _parse_results(raw_results):
results = []
Loading