+
     h$  c                   s   R t ^ RIH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.
)Optional)Iterator)DBusConnection)	SS_PREFIXSS_PATH)Session)LockedExceptionItemNotFoundExceptionPromptDismissedException)Item)DBusAddressWrapperexec_promptformat_secretopen_sessionunlock_objects
CollectionZServicez(/org/freedesktop/secrets/aliases/defaultz+/org/freedesktop/secrets/collection/sessionc                   s   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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V 3R lR ltRV 3R lR lltRtV tR# )r   zRepresents a collection.Nc                s@   < V ^8  d   QhRS[ RS[RS[S[,          RR/# )   
connectioncollection_pathsessionreturnN)r   strr    r   format__classdict__   "=/usr/lib/python3.14/site-packages/secretstorage/collection.py__annotate__Collection.__annotate__'   s1     / /> /"%/"7+/7;/    c                s    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__ZCollection.__init__'   s=     %.--z;%%g.r   c                    < V ^8  d   QhRS[ /# r   r   boolr   r   r   r   r   1   s     = =4 =r   c                sJ    \        V P                  P                  R4      4      # )zBReturns :const:`True` if item is locked, otherwise
:const:`False`.ZLocked)r'   r    r!   r"      &r   	is_lockedZCollection.is_locked1   s      D$$11(;<<r   c                   < V ^8  d   QhRR/# r   r   N r   r   r   r   r   6   s     ; ;4 ;r   c                sH    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(   r)   r   ensure_not_lockedZCollection.ensure_not_locked6   s"     >>!"9:: r   c                r$   r%   r&   r   r   r   r   r   <   s     
G 
G 
Gr   c                sD    \        V P                  V P                  .4      # )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.

.. versionchanged:: 3.0
   No longer accepts the ``callback`` argument.
)r   r   r   r(   r)   r   unlockZCollection.unlock<   s     doo0D0D/EFFr   c                r+   r,   r-   r   r   r   r   r   H   s     ; ;d ;r   c                s    \        \        \        V P                  4      pVP	                  RRV P
                  .4       R# )zLocks the collection.ZLockZaoN)r
   r   SERVICE_IFACEr   callr   )r"   service   & r   lockZCollection.lockH   s-    $WmT__MVTD$8$8#9:r   c                r+   r,   r-   r   r   r   r   r   M   s     D D Dr   c                s    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.ZDelete Z/Prompt dismissed.N)r.   r    r1   r   r   r   )r"   prompt	dismissedZ_results   &   r   deleteZCollection.deleteM   s[     ""''"5S=!,T__f!EI./BCC  r   c                s0   < V ^8  d   QhRS[ S[,          /# r%   )r   r	   r   r   r   r   r   V   s     A Ax~ Ar   c              #  s   "   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.ZItemsN)r    r!   r	   r   r   )r"   	item_pathr3   r   get_all_itemsZCollection.get_all_itemsV   s6     ))66w?It	<<@@ @s   AA	c                sL   < V ^8  d   QhRS[ S[S[3,          RS[S[,          /# )r   
attributesr   )dictr   r   r	   r   r   r   r   r   [   s+     A AtCH~ A(4. Ar   c              #  s   "   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    r1   r	   r   r   )r"   r<   resultr:      &&  r   search_itemsZCollection.search_items[   sB      ""''w
KIt	<<@@  s   AAc                r$   r%   r   r   r   r   r   r   b   s      3 r   c                sl    V P                   P                  R4      p\        V\        4      '       g   Q hV# )zReturns the collection label.r   )r    r!   Z
isinstancer   r"   labelr3   r   	get_labelZCollection.get_labelb   s0      --g6%%%%%r   c                s$   < V ^8  d   QhRS[ RR/# )r   rE   r   NrC   r   r   r   r   r   h   s     ; ;s ;t ;r   c                s`    V P                  4        V P                  P                  RRV4       R# )z!Sets collection label to `label`.r   sN)r.   r    Zset_propertyrD      &&r   	set_labelZCollection.set_labelh   s&     %%gsE:r   c                sT   < V ^8  d   QhRS[ RS[S[ S[ 3,          RS[RS[RS[ RS[/# )r   rE   r<   secretreplacecontent_typer   )r   r=   Zbytesr'   r	   r   r   r   r   r   m   sC     > > >$sCx. >!>,0>"%>9=>r   c                s8   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.LabelrG   zItem.Attributesr?   Z
CreateItemza{sv}(oayays)br6   o)r.   r   r   r   r   r   r    r1   lenr	   r   r   )r"   rE   r<   rJ   rK   rL   Z_secret
propertiesr:   r7   r8   r@   	signatures   &&&&&&       r   create_itemZCollection.create_itemm   s     	 |||'8DLfC$sEl))GZ+@

 !,,11
	 y>ALLAA'@	*+>??%	CDOOY==r   )r    r   r   r   )Fz
text/plain)Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__DEFAULT_COLLECTIONr#   r*   r.   r/   r4   r9   r;   rB   rF   rI   rQ   Z__static_attributes__Z__classdictcell__)r   s   @r   r   r   $   s     " );.2/ /= =
; ;
G 
G; ;
D DA A
A A ; ;
> > >r   Nc          
      sj    V ^8  d   QhR\         R\        R\        R\        \        ,          R\        /# )r   r   rE   aliasr   r   )r   r   r    r   r   r      "r   r   r      s=     D D. D DS D'0D<FDr   c                sL   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.LabelrG   ZCreateCollectionza{sv}s)r   r6   rM   )
r   r   r
   r   r0   r1   rN   r   r   r   )r   rE   rT   r   rO   r2   r   r7   r8   r@   rP   s   &&&&       r   create_collectionrW      s     z*003,?J -DG%ll+=x+5>O
?a*wGG#J7I&':;;!'Ij7CCr   c                sF    V ^8  d   QhR\         R\        \        ,          /# r   r   r   )r   r   r   rU   rV   r   r   r      s     6 6N 6x
7K 6r   c              #  s   "   \        \        \        V 4      pVP                  R4       F  p\	        W4      x  K  	  R# 5i)z1Returns a generator of all available collections.ZCollectionsN)r
   r   r0   r!   r   )r   r2   r   s   &  r   get_all_collectionsrY      s3      -DG"//>55 ?s   =?c                sR    V ^8  d   QhR\         R\        \        ,          R\        /# )r   r   r   r   )r   r    r   r   rU   rV   r   r   r      s-     L L~ L$,W$5LAKLr   c                sX     \        V 4      #   \         d    \        T RRT4      u # i ; i)z@Returns the default collection. If it doesn't exist,
creates it.ZDefaultZdefault)r   r   rW   )r   r   rH   r   get_default_collectionrZ      s5    L*%%  L Y	7KKLs   
 ))c                s0    V ^8  d   QhR\         R\        /# rX   )r   r   rU   rV   r   r   r      s     = => =j =r   c                s     \        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_COLLECTIONZlistrY   )r   Zcollectionsr3   r   get_any_collectionr\      st    *%%   *&899  *:67K1~#$;<<s   
 / ==c                s<    V ^8  d   QhR\         R\        R\        /# )r   r   rT   r   )r   r   r   rU   rV   r   r   r      s#     	3 	3 	3#&	3+5	3r   c                s    \        \        \        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`.Z	ReadAliasrG   zNo collection with such alias.)r
   r   r0   r1   rN   r   r   )r   rT   r2   r   rA   r   get_collection_by_aliasr]      sK    
 !-DG||Ke<O
?q #$DEEj22r   c                st    V ^8  d   QhR\         R\        \        \        3,          R\        \        ,          /# )r   r   r<   r   )r   r=   r   r   r	   rU   rV   r   r   r      s/     * *^ *!#s(^*08*r   c              #  s   "   \        \        \        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.r>   r?   N)r
   r   r0   r1   r	   )r   r<   r2   ZlockedZunlockedr:   s   &&    r   rB   rB      sE      !-DG||M7JGF&&	:)) 's   A	A)r5   N)N)#rR   Ztypingr    Zcollections.abcr   Zjeepney.io.blockingr   Zsecretstorage.definesr   r   Zsecretstorage.dhcryptor   Zsecretstorage.exceptionsr   r   r   Zsecretstorage.itemr	   Zsecretstorage.utilr
   r   r   r   r   r   r0   rS   r[   r   rW   rY   rZ   r\   r]   rB   r-   r   r   <module>r^      s     $ . 4 *  #- - |+ I%? B h> h>VD06L=.	3*r   