
    Hdl                         d Z ddlmZ ddlmZmZmZ ddlmZm	Z	m
Z
mZmZmZmZ ddlmZ ddlmZmZmZmZmZ ddlmZ dZd	                     eee                    Zg d
ZdefdZdede fdZ!dS )zThis 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      .)r   r   r   r   r   r   r   check_service_availabilityr   	dbus_initr	   r   r   r
   r   returnc                  (   	 t                      } t          |            | S # t          $ r5}d                    |j        d                   }t          |          |d}~wt          t          f$ r"}t          t          |                    |d}~ww xY w)a  Returns 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 unsetr   N)	r   r   KeyErrorformatargsr   ConnectionError
ValueErrorstr)
connectionexreasons      6lib/python3.11/site-packages/secretstorage/__init__.pyr   r   +   s    8	<#%%**	 ; ; ;-44RWQZ@@&*622:	*% < < <*3r7733;<s    ! 
B0AB/BBr"   c                     ddl m} t          t          |           }|                    |          d         dk    p||                                d         v S )zReturns 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'   r   r   NameHasOwnerListActivatableNames)r"   r'   proxys      r%   r   r   S   sc     )(((((	{J	'	'			H	%	%a	(A	- 
82244Q779    N)"__doc__jeepney.bus_messagesr   jeepney.io.blockingr   r   r   secretstorage.collectionr   r   r	   r
   r   r   r   secretstorage.itemr   secretstorage.exceptionsr   r   r   r   r   r(   r   __version_tuple__joinmapr!   __version____all__r   boolr    r,   r%   <module>r:      s    - , , , , , K K K K K K K K K K' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' $ # # # # #1 1 1 1 1 1 1 1 1 1 1 1 1 1 / . . . . . hhss3 12233  $%<> %< %< %< %<P	9> 	9d 	9 	9 	9 	9 	9 	9r,   