From 4a9591ca1ef4f93bcd2a3d4429969d24c766d428 Mon Sep 17 00:00:00 2001 From: stroeder Date: Sun, 19 Nov 2017 16:50:18 +0000 Subject: [PATCH] removed class ldap.ldapobject.NonblockingLDAPObject --- CHANGES | 1 + Lib/ldap/ldapobject.py | 37 +------------------------------------ 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/CHANGES b/CHANGES index 7aaef0f..1d3bba0 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,7 @@ Modules/ Lib/ * removed all dependencies on modules string and types * removed use of .has_key() +* removed class ldap.ldapobject.NonblockingLDAPObject * new global constant ldap.LIBLDAP_API_INFO * right after importing _ldap there is a call into libldap to initialize it * method .decodeControlValue() of SSSResponseControl and VLVResponseControl diff --git a/Lib/ldap/ldapobject.py b/Lib/ldap/ldapobject.py index e374858..855dabf 100644 --- a/Lib/ldap/ldapobject.py +++ b/Lib/ldap/ldapobject.py @@ -6,12 +6,11 @@ from os import strerror -from ldap import __version__ +from ldap.pkginfo import __version__, __author__, __license__ __all__ = [ 'LDAPObject', 'SimpleLDAPObject', - 'NonblockingLDAPObject', 'ReconnectLDAPObject', ] @@ -760,40 +759,6 @@ def get_naming_contexts(self): ).get('namingContexts', []) -class NonblockingLDAPObject(SimpleLDAPObject): - - def __init__(self,uri,trace_level=0,trace_file=None,result_timeout=-1): - self._result_timeout = result_timeout - SimpleLDAPObject.__init__(self,uri,trace_level,trace_file) - - def result(self,msgid=ldap.RES_ANY,all=1,timeout=-1): - """ - """ - ldap_result = self._ldap_call(self._l.result,msgid,0,self._result_timeout) - if not all: - return ldap_result - start_time = time.time() - all_results = [] - while all: - while ldap_result[0] is None: - if (timeout>=0) and (time.time()-start_time>timeout): - self._ldap_call(self._l.abandon,msgid) - raise ldap.TIMEOUT( - "LDAP time limit (%d secs) exceeded." % (timeout) - ) - time.sleep(0.00001) - ldap_result = self._ldap_call(self._l.result,msgid,0,self._result_timeout) - if ldap_result[1] is None: - break - all_results.extend(ldap_result[1]) - ldap_result = None,None - return all_results - - def search_st(self,base,scope,filterstr='(objectClass=*)',attrlist=None,attrsonly=0,timeout=-1): - msgid = self.search(base,scope,filterstr,attrlist,attrsonly) - return self.result(msgid,all=1,timeout=timeout) - - class ReconnectLDAPObject(SimpleLDAPObject): """ In case of server failure (ldap.SERVER_DOWN) the implementations