%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.9/site-packages/passlib/utils/compat/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.9/site-packages/passlib/utils/compat/__pycache__/__init__.cpython-39.pyc

a

f�Wc�7�@s`dZddlZejdkZejdkZejdksDdejkr@dkrLnned��ejdkZej�d�Z	e
ed	�Zer�ejd
kr�ed��dej
vZddlZe�e�Zer�ddlZnddlZd
d�Zgd�Ze�Zer�eZdd�ZeefZefZnejZdd�ZefZefZeZ eZ!ed�j"Z#dj"Z$e�rddd�Z%dd�Z&dd�Z'dd�Z(eZ)Z*dd�Z+dd �Z,d!d"�Z-n@d#d�Z%d$d�Z&d%d�Z'd&d�Z(d'd(�Z)e$Z*e.Z+d)d �Z,d*d"�Z-ee%d+�ee&d,�ee'd-�ee(d.�ee,d/�ee-d0�e�r�e/fZ0e/e1fZ2ne/e3fZ0e/e3e1fZ2e�r<e4Z5d1d2�Z6e7Z8d3d4�Z9d5d6�Z:d7d8�Z;e<Z=n0e>Z5e7Z6dd9l?m8Z8m=Z=d:d4�Z9d;d6�Z:d<d8�Z;ee;d=�e�r�d>Z@nd?Z@d@dA�ZAdBdC�ZBd[dDdE�ZCeCZDe�r�edFdGdGdHdI�ZeEedJ�ZFnedKdLdKdMdI�ZdNdO�ZFe�r�dPedQ<ndRedQ<zddSlGmHZHWn$eI�y*GdTdU�dUeJ�ZHYn0ddVlKmLZLdWdX�ZMGdYdZ�dZeL�ZNeN�Oee�dS)\z7passlib.utils.compat - python 2/3 compatibility helpers�N)�r)��)rrz?Passlib requires Python 2.6, 2.7, or >= 3.2 (as of passlib 1.7))r��java�pypy_version_info)rrz0passlib requires pypy >= 2.0 (as of passlib 1.7)ZPystoncCs
||_dS)zadd docstring to an objectN)�__doc__)�obj�doc�r�A/usr/lib/python3.9/site-packages/passlib/utils/compat/__init__.py�add_doc*sr
)"�PY2�PY3�PY26�BytesIO�StringIO�NativeStringIO�SafeConfigParser�print_�	int_types�	num_types�unicode_or_bytes_types�native_string_types�u�unicode�
uascii_to_str�
bascii_to_str�
str_to_uascii�
str_to_bascii�join_unicode�
join_bytes�join_byte_values�join_byte_elems�byte_elem_value�iter_byte_values�irange�imap�lmap�	iteritems�
itervalues�next�OrderedDict�nullcontext�get_method_functionr
cCst|t�sJ�|S�N��
isinstance�str��srrrresrcCst|t�sJ�|�d�S)NZunicode_escape�r1r2�decoder3rrrros��cCst|t�sJ�|Sr/�r1rr3rrrr�srcCst|t�sJ�|�d�S�N�ascii)r1�bytesr6r3rrrr�srcCst|t�sJ�|Sr/r0r3rrrr�srcCst|t�sJ�|�d�Sr:)r1r2�encoder3rrrr�srcCst|t�sJ�|Sr/)r1�int)�elemrrrr$�sr$cCst|t�sJ�|Sr/�r1r<r3rrrr%�sr%cCst|t�sJ�dd�|D�S)Ncss|]}t|g�VqdSr/)r<��.0�crrr�	<genexpr>�r8z"iter_byte_chars.<locals>.<genexpr>r@r3rrr�iter_byte_chars�srEcCst|t�sJ�|�d�Sr:)r1rr=r3rrrr�scCst|t�sJ�|Sr/r@r3rrrr�scCst|t�sJ�|�d�Sr:r5r3rrrr�scCst|t�sJ�|Sr/r0r3rrrr�scCstdd�|D��S)Ncss|]}t|�VqdSr/)�chr)rB�vrrrrD�r8z#join_byte_values.<locals>.<genexpr>)r!��valuesrrrr"�sr"cCst|t�sJ�dd�|D�S)Ncss|]}t|�VqdSr/)�ordrArrrrD�r8z#iter_byte_values.<locals>.<genexpr>r@r3rrrr%�scCst|t�sJ�|Sr/r@r3rrrrE�sz-helper to convert ascii unicode -> native strz+helper to convert ascii bytes -> native strz-helper to convert ascii native str -> unicodez+helper to convert ascii native str -> bytesz2iterate over byte string as sequence of ints 0-255z6iterate over byte string as sequence of 1-byte stringscOstt|i|���Sr/)�list�map)�a�krrrr(�sr(cCs|��Sr/)�items��drrrr)�sr)cCs|��Sr/rHrPrrrr*�sr*cCs|jSr/)�__next__�r	rrr�
nextgetter�srT)r'�izipcCs|��Sr/)r)rPrrrr)scCs|��Sr/)r*rPrrrr*scCs|jSr/)r+rSrrrrT
sz;return function that yields successive values from iterable�__func__Zim_funccCst|t|�S)z4given (potential) method, return underlying function)�getattr�method_function_attr��funcrrrr.sr.cCstr|S|jS)z0given unbound method, return underlying function)rrVrYrrr�get_unbound_method_function"sr[cCs||_d|_|S)z�
    backward compat hack to suppress exception cause in python3.3+

    one python < 3.3 support is dropped, can replace all uses with "raise exc from None"
    T)�	__cause__�__suppress_context__)�exc�causerrr�
error_from&sr`z
io.BytesIOzio.StringIOzconfigparser.ConfigParser)rZ	UnicodeIOrr�printzcStringIO.StringIOzStringIO.StringIOzConfigParser.SafeConfigParserc	Os|�dtj�}|�dd�}|�dd�}|r2td��|dur>dSt|t�pbt|t�pbtdd�|D��}|dur~|rxtd�nd}nt|t�s�td	��|dur�|r�td
�nd
}nt|t�s�td��d}|j	}|D]0}|r�d
}n||�t|t
�s�t|�}||�q�||�dS)zThe new-style print function.�file�sepN�endzinvalid keyword argumentscss|]}t|t�VqdSr/r9)rB�argrrrrDXr8zprint_.<locals>.<genexpr>�
zend must be None or a string� zsep must be None or a stringTF)�pop�sys�stdout�	TypeErrorr1r�anyrr�write�
basestringr2)	�args�kwds�fprcrdZwant_unicode�firstrmrerrrrIs8�



rz.passlib.utils.compat._ordered_dict.OrderedDictr,zcollections.OrderedDict)r-c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
r-zE
        Context manager that does no additional processing.
        NcCs
||_dSr/��enter_result)�selfrtrrr�__init__�sznullcontext.__init__cCs|jSr/rs)rurrr�	__enter__�sznullcontext.__enter__cGsdSr/r)ru�exc_inforrr�__exit__�sznullcontext.__exit__)N)�__name__�
__module__�__qualname__rrvrwryrrrrr-�s
r-)�
ModuleTypecCs*|�dd�\}}t||gdd�}t||�S)zChelper to import object from module; accept format `path.to.object`�.�r)�fromlist�level)�rsplit�
__import__rW)�source�modnameZmodattr�modrrr�_import_object�sr�c@s>eZdZdZedd��Zd
dd�Zdd�Zd	d
�Zdd�Z	dS)�_LazyOverlayModuleagproxy module which overlays original module,
    and lazily imports specified attributes.

    this is mainly used to prevent importing of resources
    that are only needed by certain password hashes,
    yet allow them to be imported from a single location.

    used by :mod:`passlib.utils`, :mod:`passlib.crypto`,
    and :mod:`passlib.utils.compat`.
    cCs$tj|}||||�}|tj|<|Sr/)ri�modules)�cls�name�attrmapZorigrurrr�replace_module�s

z!_LazyOverlayModule.replace_moduleNcCs(t�||�||_||_t�|�|_dSr/)r}rv�_LazyOverlayModule__attrmap�_LazyOverlayModule__proxy�logging�	getLogger�_LazyOverlayModule__log)rur�r��proxyrrrrv�sz_LazyOverlayModule.__init__cCs~|j}|rt||�rt||�S|j}||vrl||}t|�rD|�}nt|�}t|||�|j�d||�|St	d|f��dS)Nzloaded lazy attr %r: %rz%'module' object has no attribute '%s')
r��hasattrrWr��callabler��setattrr��debug�AttributeError)ru�attrr�r�r��valuerrr�__getattr__�s
z_LazyOverlayModule.__getattr__cCs |j}|rt|�St�|�SdSr/)r��reprr}�__repr__)rur�rrrr��sz_LazyOverlayModule.__repr__cCsJtt|j��}|�|j�|�|j�|j}|durB|�t|��t|�Sr/)�set�dir�	__class__�update�__dict__r�r�rK)ru�attrsr�rrr�__dir__�sz_LazyOverlayModule.__dir__)N)
rzr{r|r�classmethodr�rvr�r�r�rrrrr��s

r�)N)Prri�version_inforr�RuntimeErrorr�platform�
startswithZJYTHONr�ZPYPYr�versionZPYSTONr�r�rz�log�builtinsZ__builtin__r
�__all__�dictZ_lazy_attrsr2rrr<rrrnZunicode_or_bytesZunicode_or_str�joinr r!rrrrr"r#r$r%rErJr>r�floatrZlong�ranger&r(rLr'r)r*rT�ziprUZxrange�	itertoolsrXr.r[r`Zsuppress_causerWr�
contextlibr-�ImportError�object�typesr}r�r�r�rrrr�<module>s�

$



+











�
��-
:

Zerion Mini Shell 1.0