Skip to content

Commit

Permalink
ldap.resiter.ResultProcessor.allresults() now takes new key-word
Browse files Browse the repository at this point in the history
argument add_ctrls which is internally passed to LDAPObject.result4()
and lets the method also return response control along with the search
results.
  • Loading branch information
stroeder committed Sep 18, 2015
1 parent f79033b commit 6209906
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Changes since 2.4.20:
Lib/
* LDAPObject.read_s() now returns None instead of raising
ldap.NO_SUCH_OBJECT in case the search operation returned emtpy result.
* ldap.resiter.ResultProcessor.allresults() now takes new key-word
argument add_ctrls which is internally passed to LDAPObject.result4()
and lets the method also return response control along with the search
results.

Tests/
* Unit tests for module ldif (thanks to Petr Viktorin)
Expand Down Expand Up @@ -1190,4 +1194,4 @@ Released 2.0.0pre02 2002-02-01
----------------------------------------------------------------
Released 1.10alpha3 2000-09-19

$Id: CHANGES,v 1.353 2015/09/18 14:51:44 stroeder Exp $
$Id: CHANGES,v 1.354 2015/09/18 20:20:32 stroeder Exp $
8 changes: 4 additions & 4 deletions Lib/ldap/resiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
See http://www.python-ldap.org/ for details.
\$Id: resiter.py,v 1.6 2011/07/28 08:23:32 stroeder Exp $
\$Id: resiter.py,v 1.7 2015/09/18 20:20:32 stroeder Exp $
Python compability note:
Requires Python 2.3+
Expand All @@ -15,15 +15,15 @@ class ResultProcessor:
Mix-in class used with ldap.ldapopbject.LDAPObject or derived classes.
"""

def allresults(self,msgid,timeout=-1):
def allresults(self,msgid,timeout=-1,add_ctrls=0):
"""
Generator function which returns an iterator for processing all LDAP operation
results of the given msgid retrieved with LDAPObject.result3() -> 4-tuple
"""
result_type,result_list,result_msgid,result_serverctrls = self.result3(msgid,0,timeout)
result_type,result_list,result_msgid,result_serverctrls,_,_ = self.result4(msgid,0,timeout,add_ctrls=add_ctrls)
while result_type and result_list:
# Loop over list of search results
for result_item in result_list:
yield (result_type,result_list,result_msgid,result_serverctrls)
result_type,result_list,result_msgid,result_serverctrls = self.result3(msgid,0,timeout)
result_type,result_list,result_msgid,result_serverctrls,_,_ = self.result4(msgid,0,timeout,add_ctrls=add_ctrls)
return # allresults()

0 comments on commit 6209906

Please sign in to comment.