File: //lib64/python3.9/site-packages/ldap/__pycache__/functions.cpython-39.opt-1.pyc
a
�.d
� @ s� d Z ddlmZ g d�ZddlZddlZddlZddlZddlZddlm Z ddlm
Z
ddlmZm
Z
ddlmZ d d
� Zdejdddfdd�Zd
d� Zdd� Zdd� Zdd� Zdd� ZdS )z_
functions.py - wraps functions of module _ldap
See https://www.python-ldap.org/ for details.
� )�__version__)
�open�
initialize�init�
explode_dn�explode_rdn�
get_option�
set_option�
escape_str� strf_secs� strp_secsN)�timegm)� LDAPError)r r ��
LDAPObjectc
O s� | r| � � z2z||i |��}W | r<| �� n| r:| �� 0 W nH ty� } z0drptjdkrptj�dt |� � � W Y d}~n
d}~0 0 dr�tjdkr�tj�dt�
|� � |S )z�
Wrapper function which locks and logs calls to function
lock
Instance of threading.Lock or compatible
func
Function to call with arguments passed in via *args and **kwargs
F� z=> LDAPError: %s
Nz=> result:
%s
)�acquire�ldap�pprint� traceback�releaser Z_trace_levelZ_trace_file�write�strZpformat)�lock�func�args�kwargs�result�e� r �4/usr/lib64/python3.9/site-packages/ldap/functions.py�_ldap_function_call s
�r! c K s t | ||||fd|i|��S )a�
Return LDAPObject instance by opening LDAP connection to
LDAP host specified by LDAP URL
Parameters:
uri
LDAP URL containing at least connection scheme and hostport,
e.g. ldap://localhost:389
trace_level
If non-zero a trace output of LDAP calls is generated.
trace_file
File object where to write the trace output to.
Default is to use stdout.
bytes_mode
Whether to enable :ref:`bytes_mode` for backwards compatibility under Py2.
fileno
If not None the socket file descriptor is used to connect to an
LDAP server.
Additional keyword arguments (such as ``bytes_strictness``) are
passed to ``LDAPObject``.
�filenor )ZuriZtrace_levelZ
trace_fileZtrace_stack_limitZ
bytes_moder"