+
    Jie&                     
   R t ^ RIHt ^ RIHt ^ RIHtHt ^ RIH	t	 ^ RI
HtHtHt ^ RIHt ^ RIHtHtHtHtHt ]R,           t]R	,           tR
tRt ! R R4      tRR R lltR R ltRR R lltR R ltR R ltR R lt R# )az  Collection is a place where secret items are stored. Normally, only
the default collection should be used, but this module allows to use any
registered collection. Use :func:`get_default_collection` to get the
default collection (and create it, if necessary).

Collections are usually automatically unlocked when user logs in, but
collections can also be locked and unlocked using :meth:`Collection.lock`
and :meth:`Collection.unlock` methods (unlocking requires showing the
unlocking prompt to user and blocks until user accepts or declines it).
Creating new items and editing existing ones is possible only in unlocked
collections.
)Iterator)DBusConnection)SS_PATH	SS_PREFIX)Session)ItemNotFoundExceptionLockedExceptionPromptDismissedException)Item)DBusAddressWrapperexec_promptformat_secretopen_sessionunlock_objects
CollectionServicez(/org/freedesktop/secrets/aliases/defaultz+/org/freedesktop/secrets/collection/sessionc                     a  ] tR t^-t o Rt]R3V 3R lR lltV 3R lR ltV 3R lR ltRV 3R	 lR
 llt	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltRV 3R lR lltV 3R lR ltRtV tR# )r   zRepresents a collection.Nc                >   < V ^8  d   QhRS[ RS[RS[R,          RR/# )   
connectioncollection_pathsessionNreturn)r   strr   )format__classdict__s   "8lib/python3.14/site-packages/secretstorage/collection.py__annotate__Collection.__annotate__0   s0     / /> /"%/!D./48/    c                    Wn         W0n        W n        \        V\        V4      V n        V P
                  P                  R 4       R# )LabelN)r   r   r   r   COLLECTION_IFACE_collectionget_property)selfr   r   r   s   &&&&r   __init__Collection.__init__0   s=     %.--z;%%g.r   c                    < V ^8  d   QhRS[ /# r   r   )bool)r   r   s   "r   r   r   :   s     = =4 =r   c                J    \        V P                  P                  R4      4      # )zBReturns :const:`True` if item is locked, otherwise
:const:`False`.Locked)r*   r#   r$   r%   s   &r   	is_lockedCollection.is_locked:   s      D$$11(;<<r   c                   < V ^8  d   QhRR/# r   r   N )r   r   s   "r   r   r   ?   s     ; ;4 ;r   c                H    V P                  4       '       d   \        R4      hR# )zQIf collection is locked, raises
:exc:`~secretstorage.exceptions.LockedException`.zCollection is locked!N)r.   r   r-   s   &r   ensure_not_lockedCollection.ensure_not_locked?   s"     >>!"9:: r   c                4   < V ^8  d   QhRS[ R,          RS[/# )r   timeoutNr   )floatr*   )r   r   s   "r   r   r   E   s#     X Xedl Xd Xr   c                H    \        V P                  V P                  .VR7      # )a  Requests unlocking the collection.

Returns a boolean representing whether the prompt has been
dismissed; that means :const:`False` on successful unlocking
and :const:`True` if it has been dismissed.

:raises: ``TimeoutError`` if `timeout` (in seconds) passed
   and the prompt was neither accepted nor dismissed.

.. versionchanged:: 3.0
   No longer accepts the ``callback`` argument.

.. versionchanged:: 3.5
   Added ``timeout`` argument.
)r7   )r   r   r   )r%   r7   s   &&r   unlockCollection.unlockE   s       doo0D0D/EwWWr   c                   < V ^8  d   QhRR/# r1   r2   )r   r   s   "r   r   r   W   s     ; ;d ;r   c                    \        \        \        V P                  4      pVP	                  RRV P
                  .4       R# )zLocks the collection.LockaoN)r   r   SERVICE_IFACEr   callr   )r%   services   & r   lockCollection.lockW   s-    $WmT__MVTD$8$8#9:r   c                   < V ^8  d   QhRR/# r1   r2   )r   r   s   "r   r   r   \   s     D D Dr   c                    V P                  4        V P                  P                  RR4      w  pVR8w  d.   \        V P                  V4      w  r#V'       d   \        R4      hR# R# )z/Deletes the collection and all items inside it.Delete /Prompt dismissed.N)r4   r#   rA   r   r   r	   )r%   prompt	dismissed_results   &   r   deleteCollection.delete\   s[     ""''"5S=!,T__f!EI./BCC  r   c                0   < V ^8  d   QhRS[ S[,          /# r)   )r   r
   )r   r   s   "r   r   r   e   s     A Ax~ Ar   c              #     "   V P                   P                  R4       F%  p\        V P                  WP                  4      x  K'  	  R# 5i)z3Returns a generator of all items in the collection.ItemsN)r#   r$   r
   r   r   )r%   	item_paths   & r   get_all_itemsCollection.get_all_itemse   s6     ))66w?It	<<@@ @s   AA	c                L   < V ^8  d   QhRS[ S[S[3,          RS[S[,          /# )r   
attributesr   )dictr   r   r
   )r   r   s   "r   r   r   j   s+     A AtCH~ A(4. Ar   c              #     "   V P                   P                  RRV4      w  pV F%  p\        V P                  W0P                  4      x  K'  	  R# 5i)z\Returns a generator of items with the given attributes.
`attributes` should be a dictionary.SearchItemsa{ss}N)r#   rA   r
   r   r   )r%   rW   resultrS   s   &&  r   search_itemsCollection.search_itemsj   sB      ""''w
KIt	<<@@  s   AAc                    < V ^8  d   QhRS[ /# r)   r   )r   r   s   "r   r   r   q   s      3 r   c                l    V P                   P                  R4      p\        V\        4      '       g   Q hV# )zReturns the collection label.r!   )r#   r$   
isinstancer   r%   labels   & r   	get_labelCollection.get_labelq   s0      --g6%%%%%r   c                $   < V ^8  d   QhRS[ RR/# )r   rd   r   Nr`   )r   r   s   "r   r   r   w   s     ; ;s ;t ;r   c                `    V P                  4        V P                  P                  RRV4       R# )z!Sets collection label to `label`.r!   sN)r4   r#   set_propertyrc   s   &&r   	set_labelCollection.set_labelw   s&     %%gsE:r   c                T   < V ^8  d   QhRS[ RS[S[ S[ 3,          RS[RS[RS[ RS[/# )r   rd   rW   secretreplacecontent_typer   )r   rX   bytesr*   r
   )r   r   s   "r   r   r   |   sC     > > >$sCx. >!>,0>"%>9=>r   c                8   V P                  4        V P                  '       g   \        V P                  4      V n        \	        V P                  W54      p\
        R,           RV3\
        R,           RV3/pV P                  P                  RRVVV4      w  r\        V4      ^8  d!   \        V P                  WP                  4      # \        V P                  V	4      w  rV
'       d   \        R4      hVw  rVR8X  g   Q h\        V P                  WP                  4      # )	aY  Creates a new :class:`~secretstorage.item.Item` with given
`label` (unicode string), `attributes` (dictionary) and `secret`
(bytestring). If `replace` is :const:`True`, replaces the existing
item with the same attributes. If `content_type` is given, also
sets the content type of the secret (``text/plain`` by default).
Returns the created item.z
Item.Labelri   zItem.Attributesr[   
CreateItemza{sv}(oayays)brJ   o)r4   r   r   r   r   r   r#   rA   lenr
   r   r	   )r%   rd   rW   rn   ro   rp   _secret
propertiesrS   rK   rL   r\   	signatures   &&&&&&       r   create_itemCollection.create_item|   s     	 |||'8DLfC$sEl))GZ+@

 !,,11
	 y>ALLAA'@	*+>??%	CDOOY==r   c                    < V ^8  d   QhRS[ /# r)   r`   )r   r   s   "r   r   r      s     R R# Rr   c                H    R V P                  4       : RV P                  : R2# )z<Collection z path=>)re   r   r-   s   &r   __repr__Collection.__repr__   s&    dnn.18L8L7OqQQr   )r#   r   r   r   N)Fz
text/plain)__name__
__module____qualname____firstlineno____doc__DEFAULT_COLLECTIONr&   r.   r4   r:   rC   rN   rT   r]   re   rk   ry   r~   __static_attributes____classdictcell__)r   s   @r   r   r   -   s     " );+// /= =
; ;X X$; ;
D DA A
A A ; ;
> >BR Rr   Nc          
      b    V ^8  d   QhR\         R\        R\        R\        R,          R\        /# )r   r   rd   aliasr   Nr   )r   r   r   r   )r   s   "r   r   r      s<     D D. D DS D&~D9CDr   c                L   V'       g   \        V 4      p\        R,           RV3/p\        \        \        V 4      pVP                  RRWB4      w  rg\        V4      ^8  d   \        WVR7      # \        W4      w  rV'       d   \        R4      hV	w  rV
R8X  g   Q h\        WVR7      # )zCreates a new :class:`Collection` with the given `label` and `alias`
and returns it. This action requires prompting.

:raises: :exc:`~secretstorage.exceptions.PromptDismissedException`
         if the prompt is dismissed.
zCollection.Labelri   CreateCollectionza{sv}s)r   rJ   rt   )
r   r   r   r   r@   rA   ru   r   r   r	   )r   rd   r   r   rw   rB   r   rK   rL   r\   rx   s   &&&&       r   create_collectionr      s     z*003,?J -DG%ll+=x+5>O
?a*wGG#J7I&':;;!'Ij7CCr   c                F    V ^8  d   QhR\         R\        \        ,          /# r   r   r   )r   r   r   )r   s   "r   r   r      s     6 6N 6x
7K 6r   c              #     "   \        \        \        V 4      pVP                  R4       F  p\	        W4      x  K  	  R# 5i)z1Returns a generator of all available collections.CollectionsN)r   r   r@   r$   r   )r   rB   r   s   &  r   get_all_collectionsr      s3      -DG"//>55 ?s   =?c                J    V ^8  d   QhR\         R\        R,          R\        /# )r   r   r   Nr   )r   r   r   )r   s   "r   r   r      s,     L L~ L$+dNL>HLr   c                X     \        V 4      #   \         d    \        T RRT4      u # i ; i)z@Returns the default collection. If it doesn't exist,
creates it.Defaultdefault)r   r   r   )r   r   s   &&r   get_default_collectionr      s5    L*%%  L Y	7KKLs   
 ))c                0    V ^8  d   QhR\         R\        /# r   )r   r   )r   s   "r   r   r      s     = => =j =r   c                     \        V 4      #   \         d     Mi ; i \        T \        4      #   \         d     Mi ; i\        \	        T 4      4      pT'       d
   T^ ,          # \        R4      h)zReturns any collection, in the following order of preference:

- The default collection;
- The "session" collection (usually temporary);
- The first collection in the collections list.zNo collections found.)r   r   SESSION_COLLECTIONlistr   )r   collectionss   & r   get_any_collectionr      st    *%%   *&899  *:67K1~#$;<<s   
 / ==c                <    V ^8  d   QhR\         R\        R\        /# )r   r   r   r   )r   r   r   )r   s   "r   r   r      s#     	3 	3 	3#&	3+5	3r   c                    \        \        \        V 4      pVP                  RRV4      w  p\	        V4      ^8:  d   \        R4      h\        W4      # )zReturns the collection with the given `alias`. If there is no
such collection, raises
:exc:`~secretstorage.exceptions.ItemNotFoundException`.	ReadAliasri   zNo collection with such alias.)r   r   r@   rA   ru   r   r   )r   r   rB   r   s   &&  r   get_collection_by_aliasr      sK    
 !-DG||Ke<O
?q #$DEEj22r   c                t    V ^8  d   QhR\         R\        \        \        3,          R\        \        ,          /# )r   r   rW   r   )r   rX   r   r   r
   )r   s   "r   r   r      s/     * *^ *!#s(^*08*r   c              #     "   \        \        \        V 4      pVP                  RRV4      w  r4W4,            F  p\	        W4      x  K  	  R# 5i)zoReturns a generator of items in all collections with the given
attributes. `attributes` should be a dictionary.rZ   r[   N)r   r   r@   rA   r
   )r   rW   rB   lockedunlockedrS   s   &&    r   r]   r]      sE      !-DG||M7JGF&&	:)) 's   A	A)rH   Nr   )!r   collections.abcr   jeepney.io.blockingr   secretstorage.definesr   r   secretstorage.dhcryptor   secretstorage.exceptionsr   r   r	   secretstorage.itemr
   secretstorage.utilr   r   r   r   r   r"   r@   r   r   r   r   r   r   r   r   r]   r2   r   r   <module>r      s    % . 4 * 
 $  |+ I%? B qR qRhD06L=.	3*r   