%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/keyring/backends/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/keyring/backends/__pycache__/SecretService.cpython-312.pyc

�

�eV����ddlmZddlZddlmZddlmZddlmZddlm	Z	ddl
mZmZm
Z
mZ	ddlZddlmZej(e�ZGd	�d
ej.e�Zy#e$rY�0e$rY�6wxYw)�)�closingN�)�backend)�
properties)�KeyringBackend)�SimpleCredential)�	InitError�PasswordDeleteError�ExceptionRaisedContext�
KeyringLockedc�b�eZdZdZdZejdefd��Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zy)�KeyringzSecret Service KeyringzPython keyring library�returnc��t�5}tjddd�rtd��tjdkrtd��	ttj��5}tj|�std��	ddd�y#1swY�}xYw#1swYyxYw#tj$r}td|z��d}~wwxYw)NzSecretStorage required)�rz#SecretStorage 3.2 or newer requiredzJThe Secret Service daemon is neither running nor activatable through D-Busz&Unable to initialize SecretService: %s�)
r�
secretstorage�__name__�RuntimeError�__version_tuple__r�	dbus_init�check_service_availability�
exceptions�SecretStorageException)�cls�exc�
connection�es    �@/usr/lib/python3/dist-packages/keyring/backends/SecretService.py�priorityzKeyring.priority s���
#�
%�	#���"�"�	#���7�8�8��*�*�V�3��D�E�E�	M���0�0�2�3�
�z�$�?�?�
�K�&�4���L�
��	#�	#��
����0�0�	M��G�!�K�L�L��	M�sA�B�B0�-!B$�B0�B!�$B-�)B0�-B0�0C�C�Cc�|�tj�}	t|d�r!tj||j�}ntj
|�}|j�r+|j�|j�rtd��|S#tj$r}td|z��d}~wwxYw)z�If self.preferred_collection contains a D-Bus path,
        the collection at that address is returned. Otherwise,
        the default collection is returned.
        �preferred_collectionz$Failed to create the collection: %s.Nz Failed to unlock the collection!)rr�hasattr�
Collectionr"�get_default_collectionrrr	�	is_locked�unlockr)�self�bus�
collectionrs    r�get_preferred_collectionz Keyring.get_preferred_collection3s���
�%�%�'��	H��t�3�4�*�5�5�c�4�;T�;T�U�
�*�A�A�#�F�
����!������#�#�%�#�$F�G�G����
�0�0�	H��B�Q�F�G�G��	H�s�AB�B;�(B6�6B;c�r�t|d�r|j�|j�rtd��y)Nr'zFailed to unlock the item!)r#r'r&r)r(�items  rr'zKeyring.unlockFs0���4��"��K�K�M��>�>��� <�=�=��c�>�|j�}t|j�5|j|j	||��}|D]<}|j|�|j
�jd�ccddd�S	ddd�y#1swYyxYw)z,Get password of the username for the service�utf-8N)r+rr�search_items�_queryr'�
get_secret�decode�r(�service�usernamer*�itemsr-s      r�get_passwordzKeyring.get_passwordLs����2�2�4�
�
�Z�*�*�
+�	9��+�+�D�K�K���,J�K�E��
9�����D�!����(�/�/��8�8�		9�	9�
9�	9�	9�	9�s�AB�B�Bc��|j�}|j|||j��}dj||�}t	|j
�5|j
|||d��ddd�y#1swYyxYw)z,Set password for the username of the service)�applicationzPassword for '{}' on '{}'T)�replaceN)r+r2�appid�formatrr�create_item)r(r6r7�passwordr*�
attributes�labels       r�set_passwordzKeyring.set_passwordUsx���2�2�4�
��[�[��(��
�
�[�K�
�+�2�2�8�W�E��
�Z�*�*�
+�	N��"�"�5�*�h��"�M�	N�	N�	N�s�A5�5A>c�&�|j�}t|j�5|j|j	||��}|D]}|j�ccddd�S	ddd�t
d��#1swYt
d��xYw)z/Delete the stored password (only the first one)NzNo such password!)r+rrr1r2�deleter
r5s      r�delete_passwordzKeyring.delete_password]s����2�2�4�
�
�Z�*�*�
+�	%��+�+�D�K�K���,J�K�E��
%���{�{�}�$�	%�	%�
%�	%�"�"5�6�6�		%�"�"5�6�6�s�8A=�(A=�=Bc���|j|j}|j||�}|j�}t	|j
�5|j
|�}|D]h}|j|�|j�j|d�}t||j�jd��ccddd�S	ddd�y#1swYyxYw)aYGets the first username and password for a service.
        Returns a Credential instance

        The username can be omitted, but if there is one, it will use get_password
        and return a SimpleCredential containing  the username and password
        Otherwise, it will return the first username and password combo that it finds.
        r7r0N)
�schemes�schemer2r+rrr1r'�get_attributes�getrr3r4)r(r6r7rI�queryr*r8r-s        r�get_credentialzKeyring.get_credentialfs������d�k�k�*�����G�X�.���2�2�4�
�
�Z�*�*�
+�	U��+�+�E�2�E��
U�����D�!��.�.�0�4�4�V�J�5G�H��'��$�/�/�2C�2J�2J�7�2S�T�T�	U�	U�
U�	U�	U�	U�s�A4C�C�C#N)r�
__module__�__qualname__�__doc__r=r�
classproperty�floatr r+r'r9rCrFrM�r.rrrsI�� �$�E���������$�&>�9�N�7�Ur.r)�
contextlibr�logging�r�_compatrr�credentialsr�errorsr	r
rrr�secretstorage.exceptionsr�ImportError�AttributeError�	getLoggerr�log�SchemeSelectablerrSr.r�<module>r`sw����� �$�*���	��1��g����!��\U�g�&�&��\U���	���	��	�s�
A#�#A1�*A1�0A1

Zerion Mini Shell 1.0