The secretstorage.item
module¶
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 collection storing
the item is unlocked. The collection can be unlocked using collection’s
unlock()
method.
-
class
secretstorage.item.
Item
(bus, item_path, session=None)[source]¶ Represents a secret item.
-
ensure_not_locked
()[source]¶ If collection is locked, raises
LockedException
.
-
get_created
()[source]¶ Returns UNIX timestamp (integer) representing the time when the item was created.
New in version 1.1.
-
get_modified
()[source]¶ Returns UNIX timestamp (integer) representing the time when the item was last modified.
-
set_secret
(secret, content_type='text/plain')[source]¶ Sets item secret to secret. If content_type is given, also sets the content type of the secret (
text/plain
by default).
-
unlock
(callback=None)[source]¶ Requests unlocking the item. Usually, this will mean that the whole collection containing this item will be unlocked.
If callback is specified, calls it when unlocking is complete (see
exec_prompt()
description for details). Otherwise, uses the loop from GLib API and returns a boolean representing whether the operation was dismissed.New in version 2.1.2.
-