Skip to content

Commit dbe5d5e

Browse files
author
stroeder
committed
correctly markup result types, link to OpenLDAP man-page ldap_str2dn(3)
1 parent 0094b33 commit dbe5d5e

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

Doc/ldap-dn.rst

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. % $Id: ldap-dn.rst,v 1.8 2016/07/24 15:52:26 stroeder Exp $
1+
.. % $Id: ldap-dn.rst,v 1.9 2017/08/16 12:00:39 stroeder Exp $
22
33
44
:py:mod:`ldap.dn` LDAP Distinguished Name handling
@@ -27,48 +27,43 @@
2727
The :mod:`ldap.dn` module defines the following functions:
2828

2929

30-
.. function:: escape_dn_chars(s)
30+
.. function:: escape_dn_chars(s) -> string
3131

3232
This function escapes characters in string *s* which are special in LDAP
3333
distinguished names. You should use this function when building LDAP DN strings
3434
from arbitrary input.
3535

36-
.. % -> string
3736

38-
39-
.. function:: str2dn(s [, flags=0])
37+
.. function:: str2dn(s [, flags=0]) -> list
4038

4139
This function takes *s* and breaks it up into its component parts down to AVA
4240
level. The optional parameter *flags* describes the DN format of s (see
4341
:ref:`ldap-dn-flags`). Note that hex-encoded non-ASCII chars are decoded
4442
to the raw bytes.
4543

46-
.. % -> list
44+
Internally this function is implemented by calling OpenLDAP C function
45+
`ldap_str2dn(3) <https://www.openldap.org/software/man.cgi?query=ldap_str2dn&sektion=3>`_.
4746

4847

49-
.. function:: dn2str(dn)
48+
.. function:: dn2str(dn) -> string
5049

5150
This function takes a decomposed DN in *dn* and returns a single string. It's
5251
the inverse to :func:`str2dn`. Special characters are escaped with the help of
5352
function :func:`escape_dn_chars`.
5453

55-
.. % -> string
56-
5754

58-
.. function:: explode_dn(dn [, notypes=0[, flags=0]])
55+
.. function:: explode_dn(dn [, notypes=0[, flags=0]]) -> list
5956

6057
This function takes *dn* and breaks it up into its component parts. Each part
6158
is known as an RDN (Relative Distinguished Name). The optional *notypes*
6259
parameter is used to specify that only the RDN values be returned and not
6360
their types. The optional parameter *flags* describes the DN format of s (see
64-
:ref:`ldap-dn-flags`). This function is emulated by function
61+
:ref:`ldap-dn-flags`). This function is emulated by function
6562
:func:`str2dn` since the function ldap_explode_dn() in the C library is
6663
deprecated.
6764

68-
.. % -> list
69-
7065

71-
.. function:: explode_rdn(rdn [, notypes=0[, flags=0]])
66+
.. function:: explode_rdn(rdn [, notypes=0[, flags=0]]) -> list
7267

7368
This function takes a (multi-valued) *rdn* and breaks it up into a list of
7469
characteristic attributes. The optional *notypes* parameter is used to specify
@@ -77,14 +72,12 @@ The :mod:`ldap.dn` module defines the following functions:
7772
function is emulated by function :func:`str2dn` since the function
7873
ldap_explode_rdn() in the C library is deprecated.
7974

80-
.. % -> list
8175

82-
.. function:: is_dn(dn[, flags=0])
76+
.. function:: is_dn(dn[, flags=0]) -> boolean
8377

8478
This function checks whether *dn* is a valid LDAP distinguished name by
8579
passing it to function :func:`str2dn`.
8680

87-
.. % -> boolean
8881

8982
.. _ldap-dn-example:
9083

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy