Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

resiter.py 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. """
  2. ldap.resiter - processing LDAP results with iterators
  3. See https://www.python-ldap.org/ for details.
  4. """
  5. from ldap.pkginfo import __version__, __author__, __license__
  6. class ResultProcessor:
  7. """
  8. Mix-in class used with ldap.ldapopbject.LDAPObject or derived classes.
  9. """
  10. def allresults(self, msgid, timeout=-1, add_ctrls=0):
  11. """
  12. Generator function which returns an iterator for processing all LDAP operation
  13. results of the given msgid like retrieved with LDAPObject.result3() -> 4-tuple
  14. """
  15. result_type, result_list, result_msgid, result_serverctrls, _, _ = \
  16. self.result4(
  17. msgid,
  18. 0,
  19. timeout,
  20. add_ctrls=add_ctrls
  21. )
  22. while result_type and result_list:
  23. yield (
  24. result_type,
  25. result_list,
  26. result_msgid,
  27. result_serverctrls
  28. )
  29. result_type, result_list, result_msgid, result_serverctrls, _, _ = \
  30. self.result4(
  31. msgid,
  32. 0,
  33. timeout,
  34. add_ctrls=add_ctrls
  35. )
  36. return # allresults()