HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //lib64/python3.9/site-packages/ldap/__pycache__/functions.cpython-39.opt-1.pyc
a

�.d

�@s�dZddlmZgd�ZddlZddlZddlZddlZddlZddlm	Z	ddlm
Z
ddlmZm
Z
ddlmZd	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)rr��
LDAPObjectc
Os�|r|��z2z||i|��}W|r<|��n|r:|��0WnHty�}z0drptjdkrptj�dt	|���WYd}~n
d}~00dr�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�releaserZ_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_calls 		
�r!cKst|||||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"rrrr rAs
���rcCstdtj|�S)zJ
  get_option(name) -> value

  Get the value of an LDAP global option.
  N)r!�_ldapr)�optionrrr rasrcCstdtj||�S)zH
  set_option(name, value)

  Set the value of an LDAP global option.
  N)r!r#r	)r$Zinvaluerrr r	jsr	cs|t�fdd�|D��S)ze
  Applies escape_func() to all items of `args' and returns a string based
  on format string `s'.
  c3s|]}�|�VqdS)Nr)�.0�v��escape_funcrr �	<genexpr>x�zescape_str.<locals>.<genexpr>)�tuple)r(�srrr'r r
ssr
cCst�dt�|��S)zZ
    Convert seconds since epoch to a string compliant to LDAP syntax GeneralizedTime
    �
%Y%m%d%H%M%SZ)�time�strftime�gmtime)Zsecsrrr r{srcCstt�|d��S)zD
    Convert LDAP syntax GeneralizedTime to seconds since epoch
    r-)r
r.�strptime)Zdt_strrrr r�sr)�__doc__rr�__all__�sysrr.r#Zcalendarr
rZldap.dnrrZldap.ldapobjectrrr!�stdoutrrr	r
rrrrrr �<module>s (#�