+
    ei  c                  s   R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^RIH	t	H
t
 ^RIHt ^RIHt ]P                   ]	P"                  .]3,          t]P(                  ! ]4      tRsR R ltR R	 ltR
 R ltR R ltR R ltR R ltR R ltR R ltR&R R llt R&R R llt!R R lt"R R lt#R R lt$R  t%R! t&R" R# lt'R$ R% lt(R# )'z1
Core API functions and initialization routines.
)annotationsN)backendcredentials)fail)	platform_c                    V ^8  d   QhRRRR/# )   keyringbackend.KeyringBackendreturnNone Zformat   "1/usr/lib/python3.14/site-packages/keyring/core.py__annotate__r      s      / D     c                s`    \        V \        P                  4      '       g   \        R4      hV sR# )zSet current keyring backend.z1The keyring must be an instance of KeyringBackendN)Z
isinstancer   KeyringBackendZ	TypeError_keyring_backend)r      &r   set_keyringr      s)     gw5566KLLr   c                   V ^8  d   QhRR/# )r   r	   r   r   r   r   r   r   r       s     A A+ Ar   c                 sx    \         f   \        4        \        P                  ! \        P
                  \         4      # )zGet current keyring backend.)r   init_backendtypingZcastr   r   r   r   r   get_keyringr       s%    ;;w--/?@@r   c               r   )r   r	   r
   r   r   r   r   r   r   '   s     O O Or   c                 s   \         P                  ! 4       p  \        P                  ! V 4       \        P
                  P                  V R4      p\        P
                  P                  V4      '       d   RV 2p\        V4      h\        VRRR7      ;_uu_ 4       pVP                  R4       RRR4       R#   \         d     Li ; i  + '       g   i     R# ; i)z
Configure the null keyring as the default.

>>> fs = getfixture('fs')
>>> disable()
>>> disable()
Traceback (most recent call last):
...
RuntimeError: Refusing to overwrite...
keyringrc.cfgzRefusing to overwrite Zwutf-8Zencodingz7[backend]
default-keyring=keyring.backends.null.KeyringN)platformconfig_rootosZmakedirsZOSErrorpathZjoinexistsZRuntimeErrorZopenZwrite)ZrootZfilenameZmsgZfiles       r   disabler!   '   s     !D
D ww||D/2H	ww~~h&xj13	hg	.	.$

MN 
/	.   
/	.	.s   B4 C4CCC	c               $    V ^8  d   QhRRRRRR/# )r   service_namestrusernamer	   
str | Noner   r   r   r   r   r   ?   s!     > >s >c >j >r   c                4    \        4       P                  W4      # )z(Get password from the specified service.)r   get_passwordr#   r%      &&r   r(   r(   ?   s    =%%l==r   c               s(    V ^8  d   QhRRRRRRRR/# )r   r#   r$   r%   passwordr	   r
   r   r   r   r   r   r   D   s.     A As Ac AS AT Ar   c                s:    \        4       P                  WV4       R# )z3Set password for the user in the specified service.N)r   set_password)r#   r%   r+   s   &&&r   r,   r,   D   s    M|x@r   c               r"   )r   r#   r$   r%   r	   r
   r   r   r   r   r   r   I   s!     : :# : : :r   c                s8    \        4       P                  W4       R# )z:Delete the password for the user in the specified service.N)r   delete_passwordr)   r*   r   r-   r-   I   s    M!!,9r   c               s$    V ^8  d   QhRRRRRR/# )r   r#   r$   r%   r&   r	   zcredentials.Credential | Noner   r   r   r   r   r   N   s)     @ @@!+@"@r   c                r'   )z+Get a Credential for the specified service.)r   get_credentialr)   r*   r   r.   r.   N   s     =''??r   c               r   )r   r	   boolr   r   r   r   r   r   U   s     ! !D !r   c                s     V P                   ^8  # )i   )priority)r   r   r   recommendedr1   U   s    q  r   c               r   r   limitzLimitCallable | Noner   r   r   r   r   r   Y   s     ( (, (r   c                s.    \        \        V 4      4       R# )z
Load a detected backend.
N)r   _detect_backendr3   r   r   r   r   Y   s     &'r   c               r   r2   r   r   r   r   r   r   `   s      / r   c                s    V \         n        \        4       ;'       g_    \        4       ;'       gM    \	        \        V \         P                  ! 4       4      \        P                  ! 4       \         P                  R7      # )z
Return a keyring specified in the config file or infer the best available.

Limit, if supplied, should be a callable taking a backend and returning
True if that backend should be included for consideration.
)ZdefaultZkey)
r   Z_limitload_envload_configZmaxZfilterZget_all_keyringr   ZKeyringZby_priorityr5   r   r   r4   r4   `   s[     GN
 	
 	
=	
 	
5'1134LLN##	
	r   c               r   )r   keyring_namer$   r	   ztype[backend.KeyringBackend]r   r   r   r   r   r   v   s     ' 'c '.J 'r   c                s    V P                  R4      w  rp\        V4       \        P                  V,          p\	        WC4      # )a  
Load the keyring class indicated by name.

These popular names are tested to ensure their presence.

>>> popular_names = [
...      'keyring.backends.Windows.WinVaultKeyring',
...      'keyring.backends.macOS.Keyring',
...      'keyring.backends.kwallet.DBusKeyring',
...      'keyring.backends.SecretService.Keyring',
...  ]
>>> list(map(_load_keyring_class, popular_names))
[...]
Z.)Z
rpartitionZ
__import__sysZmodulesZgetattr)r8   Zmodule_nameZsepZ
class_nameZmodules   &    r   _load_keyring_classr:   v   s:     $0#:#:3#? Kj{[[%F6&&r   c               r   )r   r8   r$   r	   r   r   r   r   r   r   r      s      s '= r   c                s>    \        V 4      pVP                   V! 4       # )z~
Load the specified keyring by name (a fully-qualified name to the
keyring, such as 'keyring.backends.file.PlaintextKeyring')
)r:   r0   )r8   Zclass_   & r   load_keyringr<      s    
 !.F
OO8Or   c               r   r   r	   zbackend.KeyringBackend | Noner   r   r   r   r   r      s      / r   c                 sh     \        \        P                  R,          4      #   \         d     R# i ; i)z6Load a keyring configured in the environment variable.ZPYTHON_KEYRING_BACKENDN)r<   r   ZenvironZKeyErrorr   r   r   r6   r6      s.    BJJ'?@AA s   " 11c                 s:    \         P                  ! 4       R ,          # )r   )r   r   r   r   r   _config_pathr>      s    !O33r   c                sH    V P                  4       '       g   \        V 4      hV # N)r    FileNotFoundError)r   r   r   _ensure_pathrA      s    ;;==%%Kr   c               r   r=   r   r   r   r   r   r      s     & &2 &r   c                 s   \         P                  ! 4       p  V P                  \        \	        4       4      RR7       \        T 4        T P                  R4      '       d"   T P                  RR4      P                  4       pMR# \        T4      #   \
         d     R# i ; i  \         P                  \        3 d>    \        P                  ! R4      pTP                  RR\	        4        2,           4        R# i ; i)	z8Load a keyring using the config file in the config root.r   r   Nr   zdefault-keyringr   z/Keyring config file contains incorrect values.
zConfig file: )configparserZRawConfigParserZreadrA   r>   r@   _load_keyring_pathZhas_sectiongetstripNoOptionErrorZImportErrorlogging	getLoggerZwarningr<   )configr8   Zloggers      r   r7   r7      s     ))+FL07C vi((!::i1BCIIKL %%'   &&4 ""9->ln-./	
 s$   $B 7B BBAC65C6c               r   )r   rI   zconfigparser.RawConfigParserr	   r
   r   r   r   r   r   r      s      ;  r   c                s    V P                  RR4      P                  4       p\        P                  P	                  ^ \
        P                  P                  V4      4       R#   \        P                  \        P                  3 d     R# i ; i)z)load the keyring-path option (if present)r   zkeyring-pathN)
rD   rE   r9   r   Zinsertr   Z
expanduserrB   rF   ZNoSectionError)rI   r   r;   r   rC   rC      sd    zz)^4::<277--d34&&(C(CD s   AA! !%B
	B
r?   ))Z__doc__Z
__future__r    rB   rG   r   r9   r   Z r   r   Zbackendsr   Zutilr   r   ZCallabler   r/   ZLimitCallablerH   Z__name__Zlogr   r   r   r!   r(   r,   r-   r.   r1   r   r4   r:   r<   r6   r>   rA   r7   rC   r   r   r   <module>rJ      s    #   	 
  "  '!7!7 8$ >?! AO0>
A
:
@!(,'*4&8r   