From a0e459fc3231dbdf8f3cd2db6e89b373e7cecdd2 Mon Sep 17 00:00:00 2001 From: stroeder Date: Sun, 19 Nov 2017 18:54:28 +0000 Subject: [PATCH] ldap.resiter: PEP-8 and a small fix --- Lib/ldap/resiter.py | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/Lib/ldap/resiter.py b/Lib/ldap/resiter.py index bb72618..dc912eb 100644 --- a/Lib/ldap/resiter.py +++ b/Lib/ldap/resiter.py @@ -4,21 +4,38 @@ See https://www.python-ldap.org/ for details. """ +from ldap.pkginfo import __version__, __author__, __license__ -class ResultProcessor: - """ - Mix-in class used with ldap.ldapopbject.LDAPObject or derived classes. - """ - def allresults(self,msgid,timeout=-1,add_ctrls=0): +class ResultProcessor: """ - Generator function which returns an iterator for processing all LDAP operation - results of the given msgid retrieved with LDAPObject.result3() -> 4-tuple + Mix-in class used with ldap.ldapopbject.LDAPObject or derived classes. """ - 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.result4(msgid,0,timeout,add_ctrls=add_ctrls) - return # allresults() + + 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 like retrieved with LDAPObject.result3() -> 4-tuple + """ + result_type, result_list, result_msgid, result_serverctrls, _, _ = \ + self.result4( + msgid, + 0, + timeout, + add_ctrls=add_ctrls + ) + while result_type and result_list: + yield ( + result_type, + result_list, + result_msgid, + result_serverctrls + ) + result_type, result_list, result_msgid, result_serverctrls, _, _ = \ + self.result4( + msgid, + 0, + timeout, + add_ctrls=add_ctrls + ) + return # allresults()