← Back
Editing: collection.cpython-311.pyc
� ��b�$ � �z � d Z ddlmZmZmZ ddlmZ ddlmZm Z ddl mZ ddlm Z mZmZ ddlmZ ddlmZmZmZmZmZ ed z Zed z ZdZdZ G d � d � � Z ddedededee def d�Zdedee fd�Z ddedee defd�Z dedefd�Z!dededefd�Z"dedeeef dee fd�Z#dS )ar Collection is a place where secret items are stored. Normally, only the default collection should be used, but this module allows to use any registered collection. Use :func:`get_default_collection` to get the default collection (and create it, if necessary). Collections are usually automatically unlocked when user logs in, but collections can also be locked and unlocked using :meth:`Collection.lock` and :meth:`Collection.unlock` methods (unlocking requires showing the unlocking prompt to user and can be synchronous or asynchronous). Creating new items and editing existing ones is possible only in unlocked collection.� )�Dict�Iterator�Optional)�DBusConnection)� SS_PREFIX�SS_PATH)�Session)�LockedException�ItemNotFoundException�PromptDismissedException)�Item)�DBusAddressWrapper�exec_prompt� format_secret�open_session�unlock_objects� Collection�Servicez(/org/freedesktop/secrets/aliases/defaultz+/org/freedesktop/secrets/collection/sessionc � � e Zd ZdZedfdededee ddfd�Z de fd�Zdd �Zde fd �Z dd�Zdd�Zdee fd �Zdeeef dee fd�Zdefd�Zdeddfd�Z ddedeeef dede dedefd�ZdS )r zRepresents a collection.N� connection�collection_path�session�returnc � � || _ || _ || _ t |t |� � | _ | j � d� � d S )N�Label)r r r r �COLLECTION_IFACE�_collection�get_property)�selfr r r s �:/usr/lib/python3/dist-packages/secretstorage/collection.py�__init__zCollection.__init__% sQ � � %������.���-��-�z�;� ;�����%�%�g�.�.�.�.�.� c �P � t | j � d� � � � S )zJReturns :const:`True` if item is locked, otherwise :const:`False`.�Locked)�boolr r �r s r � is_lockedzCollection.is_locked/ s# � � �D�$�1�1�(�;�;�<�<�<r"