Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.6/site-packages/oauthlib/oauth1/rfc5849/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.6/site-packages/oauthlib/oauth1/rfc5849/__pycache__/utils.cpython-36.pyc

3

 ��c5
�@s^dZddljZddlmZmZdZdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�ZdS)zn
oauthlib.utils
~~~~~~~~~~~~~~

This module contains utility methods used by various parts of the OAuth
spec.
�N)�quote�unquoteZ>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789cs�fdd�}�j|_|S)z�Decorator which filters params to remove non-oauth_* parameters

    Assumes the decorated method takes a params dict or list of tuples as its
    first argument.
    cst|�}�|f|�|�S)N)�filter_oauth_params)�params�args�kwargs)�target��A/tmp/pip-build-_uu8ur7s/oauthlib/oauthlib/oauth1/rfc5849/utils.py�wrapperszfilter_params.<locals>.wrapper)�__doc__)rrr	)rr
�
filter_paramssr
cCs:dd�}t|t�r(tt|t|j����Stt||��SdS)zARemoves all non oauth parameters from a dict or a list of params.cSs|djd�S)NrZoauth_)�
startswith)�kvr	r	r
�<lambda>!sz%filter_oauth_params.<locals>.<lambda>N)�
isinstance�dict�list�filter�items)rZis_oauthr	r	r
rs
rcCs.t|t�s"tddj|t|����t|dd�S)z�Escape a unicode string in an OAuth-compatible fashion.

    Per `section 3.6`_ of the spec.

    .. _`section 3.6`: https://tools.ietf.org/html/rfc5849#section-3.6

    z$Only unicode objects are escapable. zGot {!r} of type {}.�~)�safe)r�str�
ValueError�format�typer)�ur	r	r
�escape(s
rcCst|t�std��t|�S)Nz%Only unicode objects are unescapable.)rrrr)rr	r	r
�unescape8s
rcCs
tj|�S)z1A unicode-safe version of urllib2.parse_keqv_list)�urllib2�parse_keqv_list)�lr	r	r
r >sr cCs
tj|�S)z1A unicode-safe version of urllib2.parse_http_list)r�parse_http_list)rr	r	r
r"Dsr"cCsldj�}|dt|��j�j|�r`t|t|�d��}ytt|�j��Sttfk
r^YnXtd��dS)z;Parse an OAuth authorization header into a list of 2-tupleszOAuth NzMalformed authorization header)	�lower�lenrr"rr r�
IndexErrorr)Zauthorization_headerZauth_schemerr	r	r
�parse_authorization_headerJsr&)r�urllib.request�requestrZoauthlib.commonrrZUNICODE_ASCII_CHARACTER_SETr
rrrr r"r&r	r	r	r
�<module>s
	

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists