Skip to content

Commit

Permalink
Rename ldap.async to ldap.asyncsearch
Browse files Browse the repository at this point in the history
Python 3.7 introduces `async` as a keyword. The old import path is still
available for backwards compatibility.

https://github.com/python-ldap/python-ldap/pull/107
Signed-off-by: Christian Heimes <cheimes@redhat.com>
  • Loading branch information
Christian Heimes authored and Petr Viktorin committed Dec 11, 2017
1 parent baa091f commit dc7a3fe
Show file tree
Hide file tree
Showing 6 changed files with 353 additions and 300 deletions.
55 changes: 33 additions & 22 deletions Doc/reference/ldap-async.rst
Original file line number Diff line number Diff line change
@@ -1,49 +1,60 @@
**************************************************************
:py:mod:`ldap.async` Stream-processing of large search results
**************************************************************
********************************************************************
:py:mod:`ldap.asyncsearch` Stream-processing of large search results
********************************************************************

.. py:module:: ldap.async
.. py:module:: ldap.asyncsearch
:synopsis: Framework for stream-processing of large search results.

With newer Python versions one might want to consider using
:py:mod:`ldap.resiter` instead.


.. versionchanged:: 3.0
In Python 3.7 ``async`` is a reserved keyword. The module
:py:mod:`ldap.async` has been renamed to :py:mod:`ldap.asyncsearch`. The
old name :py:mod:`ldap.async` is still available for backwards
compatibility.

.. deprecated:: 3.0
The old name :py:mod:`ldap.async` is deprecated, but will not be removed
until Python 3.6 reaches end-of-life.


Classes
=======

.. autoclass:: ldap.async.AsyncSearchHandler
.. autoclass:: ldap.asyncsearch.AsyncSearchHandler
:members:

.. autoclass:: ldap.async.List
.. autoclass:: ldap.asyncsearch.List
:members:

.. autoclass:: ldap.async.Dict
.. autoclass:: ldap.asyncsearch.Dict
:members:

.. autoclass:: ldap.async.IndexedDict
.. autoclass:: ldap.asyncsearch.IndexedDict
:members:

.. autoclass:: ldap.async.LDIFWriter
.. autoclass:: ldap.asyncsearch.LDIFWriter
:members:

.. _ldap.async-example:
.. _ldap.asyncsearch-example:

Examples
========

.. _ldap.async-example.List:
.. _ldap.asyncsearch-example.List:

Using ldap.async.List
^^^^^^^^^^^^^^^^^^^^^
Using ldap.asyncsearch.List
^^^^^^^^^^^^^^^^^^^^^^^^^^^

This example demonstrates how to use class ldap.async.List for
This example demonstrates how to use class ldap.asyncsearch.List for
retrieving partial search results even though the exception
:exc:`ldap.SIZELIMIT_EXCEEDED` was raised because a server side limit was hit. ::

import sys,ldap,ldap.async
import sys,ldap,ldap.asyncsearch

s = ldap.async.List(
s = ldap.asyncsearch.List(
ldap.initialize('ldap://localhost'),
)

Expand All @@ -67,17 +78,17 @@ retrieving partial search results even though the exception
)
)

.. _ldap.async-example.LDIFWriter:
.. _ldap.asyncsearch-example.LDIFWriter:

Using ldap.async.LDIFWriter
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Using ldap.asyncsearch.LDIFWriter
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This example demonstrates how to use class ldap.async.LDIFWriter
This example demonstrates how to use class ldap.asyncsearch.LDIFWriter
for writing search results as LDIF to stdout. ::

import sys,ldap,ldap.async
import sys,ldap,ldap.asyncsearch

s = ldap.async.LDIFWriter(
s = ldap.asyncsearch.LDIFWriter(
ldap.initialize('ldap://localhost:1390'),
sys.stdout
)
Expand Down
1 change: 1 addition & 0 deletions Doc/spelling_wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
args
async
asyncsearch
attr
attrlist
attrList
Expand Down
Loading

0 comments on commit dc7a3fe

Please sign in to comment.