%PDF- %PDF-
| Direktori : /usr/lib/python3.9/site-packages/passlib/__pycache__/ |
| Current File : //usr/lib/python3.9/site-packages/passlib/__pycache__/apache.cpython-39.opt-1.pyc |
a
f�WcE� � @ s d Z ddlmZ ddlZe�e�ZddlZddlm Z ddl
mZmZ ddl
mZ ddlmZ ddlmZ dd lmZmZmZ dd
lmZ ddlmZmZmZmZ dd
gZe� Z dZ!dZ"dZ#dZ$dZ%G dd� de�Z&e'� Z(dd� Z)e)� Z*dd� Z+e+� Z,G dd� de&�Z-G dd
� d
e&�Z.dS )z(passlib.apache - apache password support� )�with_statementN)�warn)�exc�registry)�CryptContext)�ExpectedStringError)�htdigest)�render_bytes�to_bytes�is_ascii_codec)�deprecated_method)�
join_bytes�unicode�BytesIO�PY3�HtpasswdFile�HtdigestFile� :� #s :
�skipped�recordc @ s e Zd ZdZdZdZdZdZdZdZ dZ
edd� �Zedd� �Z
ddddd efd
d�Zdd
� Zedd� �Zejdd� �Zedd� �Zdd� Zd2dd�Zdd� Zdd� Zdd� Zdd� Zdd � Zd3d!d"�Zd#d$� Zd%d&� Zd'd(� Zd)d*� Z d+d,� Z!d4d.d/�Z"d0d1� Z#dS )5�_CommonFilez0common framework for HtpasswdFile & HtdigestFileNFc K s, d|v rt d��| f i |��}|�|� |S )z�create new object from raw string.
:type data: unicode or bytes
:arg data:
database to load, as single string.
:param \*\*kwds:
all other keywords are the same as in the class constructor
�pathz$'path' not accepted by from_string())� TypeError�load_string)�cls�data�kwds�self� r �2/usr/lib/python3.9/site-packages/passlib/apache.py�from_stringK s
z_CommonFile.from_stringc K s | f i |��}|� |� |S )z�create new object from file, without binding object to file.
:type path: str
:arg path:
local filepath to load from
:param \*\*kwds:
all other keywords are the same as in the class constructor
)�load)r r r r r r r � from_path\ s
z_CommonFile.from_pathT�utf-8c C s� |st dtdd� d}d}nt|�s,td��|| _|| _|| _|| _d| _|s`t dtdd� d }|rr|sr| � � ni | _
g | _d S )
Nz�``encoding=None`` is deprecated as of Passlib 1.6, and will cause a ValueError in Passlib 1.8, use ``return_unicode=False`` instead.� ��
stacklevelr$ Fz'encoding must be 7-bit ascii compatibler zp``autoload=False`` is deprecated as of Passlib 1.6, and will be removed in Passlib 1.8, use ``new=True`` insteadT)r �DeprecationWarningr �
ValueError�encoding�return_unicode�autosave�_path�_mtimer"