File: fake_ldap_module_for_documentation.py

package info (click to toggle)
python-ldap 3.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,756 kB
  • sloc: python: 9,558; ansic: 3,052; makefile: 139; sh: 79
file content (30 lines) | stat: -rw-r--r-- 817 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
A module that mocks `_ldap` for the purposes of generating documentation

This module provides placeholders for the contents of `_ldap`, making it
possible to generate documentation even _ldap is not compiled.
It should also make the documentation independent of which features are
available in the system OpenLDAP library.

The overly long module name will show up in AttributeError messages,
hinting that this is not the actual _ldap.

See https://www.python-ldap.org/ for details.
"""

import sys

# Cause `import _ldap` to import this module instead of the actual `_ldap`.
sys.modules['_ldap'] = sys.modules[__name__]

from constants import CONSTANTS
from pkginfo import __version__

for constant in CONSTANTS:
    globals()[constant.name] = constant

def get_option(num):
    pass

class LDAPError:
    pass