← Back
Editing: SecretService.cpython-311.pyc
� %�cM � �� � d dl mZ d dlZddlmZ ddlmZ ddlmZ ddlm Z ddl mZmZm Z mZ d dlZd dlmZ n# e$ r Y n e$ r Y nw xY w ej e� � Z G d � d ej e� � ZdS )� )�closingN� )�backend)� properties)�KeyringBackend)�SimpleCredential)� InitError�PasswordDeleteError�ExceptionRaisedContext� KeyringLockedc �Z � e Zd ZdZdZej d� � � Zd� Zd� Z d� Z d� Zd� Zd � Z d S )�KeyringzSecret Service KeyringzPython keyring libraryc �� � t � � 5 }t j d d d � � n# 1 swxY w Y |rt d� � �t j dk rt d� � � t t j � � � � 5 }t j |� � st d� � � d d d � � n# 1 swxY w Y n)# t j $ r}t d|z � � �d }~ww xY wdS )NzSecretStorage required)� r z#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} � � #� %� %� #���"�"� #� #� #� #� #� #� #� #� #� #� #���� #� #� #� #�� 9��7�8�8�8��*�V�3�3��D�E�E�E� M���0�2�2�3�3� �z�$�?� �K�K� �&�4�� � �� � � � � � � � � � � ���� � � � ��� �0� M� M� M��G�!�K�L�L�L����� M�����qsH � (�,�,�$ C �$B5�)C �5B9�9C �<B9�=C �C'�C"�"C'c � � t j � � } t | d� � rt j || j � � }nt j |� � }n)# t j $ r}t d|z � � �d}~ww xY w|� � � r7|� � � |� � � rt d� � �|S )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!)r r �hasattr� Collectionr! �get_default_collectionr r r � is_locked�unlockr )�self�bus� collectionr s r �get_preferred_collectionz Keyring.get_preferred_collection3 s� � � �%�'�'�� H��t�3�4�4� G�*�5�c�4�;T�U�U� � �*�A�#�F�F� ����0� H� H� H��B�Q�F�G�G�G����� H�������!�!� H��������#�#�%�%� H�#�$F�G�G�G��s �?A �A;�$A6�6A;c � � t |d� � r|� � � |� � � rt d� � �d S )Nr&