Skip to content

Commit 50d6f1f

Browse files
author
stroeder
committed
removed class ldap.ldapobject.NonblockingLDAPObject
1 parent ec21363 commit 50d6f1f

File tree

2 files changed

+2
-36
lines changed

2 files changed

+2
-36
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Modules/
1313
Lib/
1414
* removed all dependencies on modules string and types
1515
* removed use of .has_key()
16+
* removed class ldap.ldapobject.NonblockingLDAPObject
1617
* new global constant ldap.LIBLDAP_API_INFO
1718
* right after importing _ldap there is a call into libldap to initialize it
1819
* method .decodeControlValue() of SSSResponseControl and VLVResponseControl

Lib/ldap/ldapobject.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66

77
from os import strerror
88

9-
from ldap import __version__
9+
from ldap.pkginfo import __version__, __author__, __license__
1010

1111
__all__ = [
1212
'LDAPObject',
1313
'SimpleLDAPObject',
14-
'NonblockingLDAPObject',
1514
'ReconnectLDAPObject',
1615
]
1716

@@ -760,40 +759,6 @@ def get_naming_contexts(self):
760759
).get('namingContexts', [])
761760

762761

763-
class NonblockingLDAPObject(SimpleLDAPObject):
764-
765-
def __init__(self,uri,trace_level=0,trace_file=None,result_timeout=-1):
766-
self._result_timeout = result_timeout
767-
SimpleLDAPObject.__init__(self,uri,trace_level,trace_file)
768-
769-
def result(self,msgid=ldap.RES_ANY,all=1,timeout=-1):
770-
"""
771-
"""
772-
ldap_result = self._ldap_call(self._l.result,msgid,0,self._result_timeout)
773-
if not all:
774-
return ldap_result
775-
start_time = time.time()
776-
all_results = []
777-
while all:
778-
while ldap_result[0] is None:
779-
if (timeout>=0) and (time.time()-start_time>timeout):
780-
self._ldap_call(self._l.abandon,msgid)
781-
raise ldap.TIMEOUT(
782-
"LDAP time limit (%d secs) exceeded." % (timeout)
783-
)
784-
time.sleep(0.00001)
785-
ldap_result = self._ldap_call(self._l.result,msgid,0,self._result_timeout)
786-
if ldap_result[1] is None:
787-
break
788-
all_results.extend(ldap_result[1])
789-
ldap_result = None,None
790-
return all_results
791-
792-
def search_st(self,base,scope,filterstr='(objectClass=*)',attrlist=None,attrsonly=0,timeout=-1):
793-
msgid = self.search(base,scope,filterstr,attrlist,attrsonly)
794-
return self.result(msgid,all=1,timeout=timeout)
795-
796-
797762
class ReconnectLDAPObject(SimpleLDAPObject):
798763
"""
799764
In case of server failure (ldap.SERVER_DOWN) the implementations

0 commit comments

Comments
 (0)