U
    ¶[Öel  ã                   @   sÔ   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d
ddddddddddddddgZedœdd„Zee dœd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               
   C   sˆ   zt ƒ } t| ƒ | W S  tk
rP } zd |jd ¡}t|ƒ|‚W 5 d}~X Y n4 ttfk
r‚ } ztt|ƒƒ|‚W 5 d}~X Y nX dS )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Úreason© r#   úX/var/www/html/services/stratfitenv/lib/python3.8/site-packages/secretstorage/__init__.pyr   +   s    )r    r   c                 C   s8   ddl m} tt| ƒ}| |¡d dkp6|| ¡ d kS )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%   r   r   ZNameHasOwnerZListActivatableNames)r    r%   Úproxyr#   r#   r$   r   S   s
    
ÿN)"Ú__doc__Zjeepney.bus_messagesr   Zjeepney.io.blockingr   r   r   Zsecretstorage.collectionr   r   r   r	   r
   r   r   Zsecretstorage.itemr   Zsecretstorage.exceptionsr   r   r   r   r   r&   r   Ú__version_tuple__ÚjoinÚmapr   Ú__version__Ú__all__r   Úboolr   r#   r#   r#   r$   Ú<module>   s4   $ñ(