File: //lib64/python3.9/site-packages/gpg/__pycache__/util.cpython-39.opt-1.pyc
a
    좃[�  �                   @   sV   d dl mZmZmZ d dlZ[[[dd� Zdd� Zejd  dkrJdd	� Znd
d	� ZdS )�    )�absolute_import�print_function�unicode_literalsNc                    sD   ddl m�  t���� ��fdd�t� �D �}|�|� t|�� �S )z�Called by the constant modules to load up the constants from the C
    library starting with PREFIX.  Matching constants will be inserted
    into SCOPE with PREFIX stripped from the names.  Returns the names
    of inserted constants.
    �   )�gpgmec                    s*   i | ]"}|� ��r|�d � t� |��qS �N)�
startswith�getattr)�.0Z
identifier�r   �index�prefix� �./usr/lib64/python3.9/site-packages/gpg/util.py�
<dictcomp>#   s   �z%process_constants.<locals>.<dictcomp>)� r   �len�dir�update�list�keys)r
   ZscopeZ	constantsr   r   r   �process_constants   s    �
r   c                 C   s   d� dd� | D ��S )Nr   c                 s   sD   | ]<}|d ks*|dks*|dks*t |�dkr8d�t |��n|V  qdS )�+�"�%�    z%{0:2x}N)�ord�format)r
   �cr   r   r   �	<genexpr>,   s   ����
�z!percent_escape.<locals>.<genexpr>)�join)�sr   r   r   �percent_escape+   s    
�r"