o ’y"`l ã@s¼dZddlmZddlmZmZmZddlmZm Z m Z m Z m Z m Z mZddlmZddlmZmZmZmZmZddlmZdZd  eeeƒ¡Zgd ¢Zd efd d „Zded e fdd„Z!dS)zThis file provides quick access to all SecretStorage API. Please refer to documentation of individual modules for API details. é)Ú message_bus)ÚDBusConnectionÚProxyÚopen_dbus_connection)Ú CollectionÚcreate_collectionÚget_all_collectionsÚget_default_collectionÚget_any_collectionÚget_collection_by_aliasÚ search_items)ÚItem)ÚSecretStorageExceptionÚ"SecretServiceNotAvailableExceptionÚLockedExceptionÚItemNotFoundExceptionÚPromptDismissedException)Úadd_match_rules)éréÚ.)rr rrrrrÚcheck_service_availabilityrÚ dbus_initrr r r r Úreturnc Cspz tƒ}t|ƒ|WSty#}z d |jd¡}t|ƒ|‚d}~wttfy7}ztt|ƒƒ|‚d}~ww)aReturns a new connection to the session bus, instance of jeepney's :class:`DBusConnection` class. This connection can then be passed to various SecretStorage functions, such as :func:`~secretstorage.collection.get_default_collection`. .. warning:: The D-Bus socket will not be closed automatically. You can close it manually using the :meth:`DBusConnection.close` method, or you can use the :class:`contextlib.closing` context manager: .. code-block:: python from contextlib import closing with closing(dbus_init()) as conn: collection = secretstorage.get_default_collection(conn) items = collection.search_items({'application': 'myapp'}) However, you will not be able to call any methods on the objects created within the context after you leave it. .. versionchanged:: 3.0 Before the port to Jeepney, this function returned an instance of :class:`dbus.SessionBus` class. .. versionchanged:: 3.1 This function no longer accepts any arguments. z Environment variable {} is unsetrN) rrÚKeyErrorÚformatÚargsrÚConnectionErrorÚ ValueErrorÚstr)Ú connectionÚexÚreason©r#ú8/usr/lib/python3/dist-packages/secretstorage/__init__.pyr+s €€ÿrr cCs8ddlm}tt|ƒ}| |¡ddkp|| ¡dvS)zŽReturns True if the Secret Service daemon is either running or available for activation via D-Bus, False otherwise. .. versionadded:: 3.2 r)ÚBUS_NAMEr)Úsecretstorage.utilr%rrÚ NameHasOwnerÚListActivatableNames)r r%Úproxyr#r#r$rSs  ÿrN)"Ú__doc__Újeepney.bus_messagesrÚjeepney.io.blockingrrrÚsecretstorage.collectionrrrr r r r Úsecretstorage.itemr Úsecretstorage.exceptionsrrrrrr&rÚ__version_tuple__ÚjoinÚmaprÚ __version__Ú__all__rÚboolrr#r#r#r$Ús $  (