← Back
Editing: item.cpython-38.pyc
U ��zW� � @ s� d Z ddlZddlmZ ddlmZ ddlmZmZm Z m Z mZmZ ddl mZmZmZ ddlmZ ed ZG d d� de�ZdS ) aQ SecretStorage item contains a *secret*, some *attributes* and a *label* visible to user. Editing all these properties and reading the secret is possible only when the :doc:`collection <collection>` storing the item is unlocked. The collection can be unlocked using collection's :meth:`~secretstorage.collection.Collection.unlock` method.� N)� SS_PREFIX)�LockedException)�InterfaceWrapper�bus_get_object�open_session� format_secret� to_unicode�unlock_objects)�Cipher� algorithms�modes)�default_backend�Itemc @ s� e Zd ZdZd$dd�Zdd� Zdd� Zd d � Zd%dd�Zd d� Z dd� Z dd� Zdd� Zdd� Z dd� Zdd� Zd&dd�Zdd� Zd d!� Zd"d#� ZdS )'r zRepresents a secret item.Nc C sL || _ t||�}|| _|| _t|t�| _t|tj�| _ | j j tddd� d S )N�Label�ss�Z signature)� item_pathr �session�busr � ITEM_IFACE� item_iface�dbusZPROPERTIES_IFACE�item_props_iface�Get)�selfr r r Zitem_obj� r �4/usr/lib/python3/dist-packages/secretstorage/item.py�__init__ s �z Item.__init__c C s | j |j kS )N)r )r �otherr r r �__eq__# s zItem.__eq__c C s t | jjtddd��S )zDReturns :const:`True` if item is locked, otherwise :const:`False`.ZLockedr r )�boolr r r �r r r r � is_locked&