|
6 | 6 |
|
7 | 7 | from os import strerror
|
8 | 8 |
|
9 |
| -from ldap import __version__ |
| 9 | +from ldap.pkginfo import __version__, __author__, __license__ |
10 | 10 |
|
11 | 11 | __all__ = [
|
12 | 12 | 'LDAPObject',
|
13 | 13 | 'SimpleLDAPObject',
|
14 |
| - 'NonblockingLDAPObject', |
15 | 14 | 'ReconnectLDAPObject',
|
16 | 15 | ]
|
17 | 16 |
|
@@ -760,40 +759,6 @@ def get_naming_contexts(self):
|
760 | 759 | ).get('namingContexts', [])
|
761 | 760 |
|
762 | 761 |
|
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 |
| - |
797 | 762 | class ReconnectLDAPObject(SimpleLDAPObject):
|
798 | 763 | """
|
799 | 764 | In case of server failure (ldap.SERVER_DOWN) the implementations
|
|
0 commit comments