/usr/lib/python3/dist-packages/oauthlib/oauth1/rfc5849/__pycache__
Edit: /usr/lib/python3/dist-packages/oauthlib/oauth1/rfc5849/__pycache__/utils.cpython-310.pyc (2796B)
o
a5
@ s` d Z ddlmZ ddlmZmZ dZdd Zdd Z d d
Z
dd Zd
d Zdd Z
dd ZdS )zn
oauthlib.utils
~~~~~~~~~~~~~~
This module contains utility methods used by various parts of the OAuth
spec.
N)quoteunquote>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789c s fdd} j |_ |S )zDecorator which filters params to remove non-oauth_* parameters
Assumes the decorated method takes a params dict or list of tuples as its
first argument.
c s t | } | g|R i |S )N)filter_oauth_params)paramsargskwargstarget ?/usr/lib/python3/dist-packages/oauthlib/oauth1/rfc5849/utils.pywrapper s zfilter_params.
.wrapper)__doc__)r
r
r r r
filter_params s r c C s6 dd }t | trtt|t| S tt|| S )zARemoves all non oauth parameters from a dict or a list of params.c S s | d dS )Nr oauth_)
startswith)kvr r r ! s z%filter_oauth_params..)
isinstancedictlistfilteritems)r is_oauthr r r r s
r c C s. t | tstdd| t| t| ddS )zEscape 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
ValueErrorformattyper ur r r escape( s
r" c C s t | ts tdt| S )Nz%Only unicode objects are unescapable.)r r r r r r r r unescape8 s
r# c C
t | S )z1A unicode-safe version of urllib2.parse_keqv_list)urllib2parse_keqv_list)lr r r r&