+
    ei  c                  s    R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^RIHtH	t	H
t
HtHtHtHtHtHt ^RIHt  ! R R4      tR	R lt]R8X  d   ]P,                  ! ]! 4       4       R# R# )
z@Simple command line interface to get/set password from a keyring)annotationsN)	backend
completioncorecredentialsdelete_passwordget_credentialget_passwordset_keyringset_password)	platform_c                  s    ] tR t^t$ R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R	&   R
 tR tR tR tR R lt	R R lt
R R ltR R ltR tR tR tR tR tR t]R 4       t]R 4       tRtR# ) CommandLineToolz
str | Nonekeyring_pathkeyring_backendstrget_modeoutput_format	operationserviceusernamec                	s   \         P                  ! 4       V n        V P                  P                  R RRRRR7       V P                  P                  RRRRR	R7       V P                  P                  R
RRR7       V P                  P                  RRRR7       RR.V P                  n        V P                  P                  RV P                  P                  RRRR7       RR.V P                  n        V P                  P                  RV P                  P
                  RRRR7       . R!OV P                  n        V P                  P                  RV P                  P                  RR7       V P                  P                  RRR7       V P                  P                  R RR7       \        P                  ! V P                  4       R# )"z-pz--keyring-pathr   NzPath to the keyring backend)destdefaulthelpz-bz--keyring-backendr   zName of the keyring backendz--list-backendsZ
store_truezList keyring backends and exit)Zactionr   z	--disablezDisable keyring and exitpasswordcredsz--moder   a  
            Mode for 'get' operation.
            'password' requires a username and will return only the password.
            'creds' does not require a username and will return both the username and password separated by a newline.

            Default is 'password'
            )choicesr   r   r   Zplainjsonz--outputr   z\
            Output format for 'get' operation.

            Default is 'plain'
            r   Z?)r   nargsr   )r   r   )getZsetZdeldiagnose)	argparseZArgumentParserparserZadd_argumentZ
_get_modesZ_output_formats_operationsr   Zinstallself   &0/usr/lib/python3.14/site-packages/keyring/cli.py__init__ZCommandLineTool.__init__"   s   --/  . 	! 	
 	  ". 	! 	
 	  1 	! 	

 	  3M 	! 	
 #-g!6  KK** 	! 	
 (/&7#  KK//  	! 
	
 #D  KK++ 	! 	

 	   	! 	
 	   	! 	
 	4;;'    c                	s"   V P                   P                  V4      p\        V 4      P                  \        V4      4       VP                  '       d*   \
        P                  ! 4        F  p\        V4       K  	  R # VP                  '       d   \        P                  ! 4        R # VP                  R8X  d   V P                  4        R # V P                  4        V P                  4        \        V RV P                   2V P                  4      pV! 4       # )Nr   Zdo_)r   Z
parse_argsZvarsZupdateZlist_backendsr   Zget_all_keyringprintZdisabler   r   r   _check_args_load_spec_backendgetattr
invalid_op)r"   argvZargsZkZmethods   &&   r$   runZCommandLineTool.rund   s    {{%%d+T
$t*%,,.a /<<<LLN>>Z'MMO!T^^$45tGxr&   c                	s  a  S P                   R 8g  ;'       g    S P                  R8g  pR.R.V,          ,           \        S P                   4      ,          p\        ;QJ d    V 3R lV 4       F  '       g   K   RM	  RM! V 3R lV 4       4      '       d<   S P                  P                  S P                    RRP                  V4       24       R	# R	# )
r   r   r   r   c              3  s@   <"   T F  p\        SV4      R J x  K  	  R # 5iN)r*   )Z.0Zparamr"   s   & r$   Z	<genexpr>Z.CommandLineTool._check_args.<locals>.<genexpr>}   s     BwtU#t+s   TFz
 requires z and N)r   r   ZboolZanyr   errorjoin)r"   Zneeds_usernameZrequireds   f  r$   r(   ZCommandLineTool._check_argsz   s    50LLDMMW4LK:,"??4CWW3BB333BBBBKK 0
7<<;Q:RST Cr&   c                	s    \        V R V P                   24      ! 4       pVf   \        ^4      h\        V RV P                   24      ! V4       R# )Z_get_NZ_emit_)r*   r   Z
SystemExitr   r"   
credential   & r$   do_getZCommandLineTool.do_get   sI    TU4==/#:;=
Q-t11234Z@r&   c                   V ^8  d   QhRR/#    r2   zcredentials.Credential Zformat   "r$   __annotate__CommandLineTool.__annotate__   s     . .%; .r&   c                	s`    \        \        P                  ! VP                  4       4      4       R # r.   )r'   r   Zdumps_varsr1      &&r$   
_emit_jsonZCommandLineTool._emit_json   s    djj))+,-r&   c               r5   r6   r8   r9   r:   r$   r;   r<      s      &< r&   c                	sf    VP                  4       P                  4        F  p\        V4       K  	  R # r.   )r=   Zvaluesr'   )r"   r2   Zvals   && r$   _emit_plainZCommandLineTool._emit_plain   s%    ##%,,.C#J /r&   c               r5   r7   Zreturnzcredentials.Credential | Noner8   r9   r:   r$   r;   r<      s     ; ;9 ;r&   c                	sB    \        V P                  V P                  4      # r.   )r   r   r   r!   r#   r$   
_get_credsZCommandLineTool._get_creds   s    dllDMM::r&   c               r5   rA   r8   r9   r:   r$   r;   r<      s     
 
< 
r&   c                	sz    \        V P                  V P                  4      pVe   \        P                  ! V4      # R # r.   )r   r   r   r   ZAnonymousCredentialr"   r   r3   r$   _get_passwordZCommandLineTool._get_password   s6    dmm<9A9MK++H5	
SW	
r&   c                	s    V P                  R V P                   RV P                   R24      p\        V P                  V P                  V4       R# )zPassword for 'z' in 'z': N)input_passwordr   r   r	   rC   r3   r$   do_setZCommandLineTool.do_set   sB    &&T]]O6$,,sC
 	T\\4==(;r&   c                	sF    \        V P                  V P                  4       R # r.   )r   r   r   r!   r#   r$   do_delZCommandLineTool.do_del   s    dmm4r&   c                	s    \         P                  ! 4       pVP                  4       '       d   \        R V4       M\        R VR4       \        R\        P
                  ! 4       4       R# )zconfig path:z(absent)z
data root:N)r   Z_config_pathZexistsr'   r
   Z	data_root)r"   Zconfig_rootr3   r$   r   ZCommandLineTool.diagnose   sH    '').+..+z:lI//12r&   c                	s    V P                   P                  R RP                  V P                   P                  4       R24       R# )zSpecify operation (z, z).N)r   r/   r0   r    r!   r#   r$   r+   ZCommandLineTool.invalid_op   s3    /		$++:Q:Q0R/SSUVWr&   c                	s`   V P                   f   R #  V P                  '       d+   \        P                  P	                  ^ V P                  4       \        \        P                  ! V P                   4      4       R #   \         d*   pT P                  P                  RT 24        R p?R # R p?ii ; i)Nz"Unable to load specified keyring: )r   r   sysZpathZinsertr   r   Zload_keyringZ	Exceptionr   r/   )r"   Zexcr3   r$   r)   Z"CommandLineTool._load_spec_backend   s    '
	J   4#4#45))$*>*>?@ 	J KK B3%HII	Js   A9 AA9 9B-B((B-c                s^    V P                  4       ;'       g    \        P                  ! V4      # )zRetrieve password from input.)pass_from_pipegetpass)r"   Zpromptr>   r$   rE   ZCommandLineTool.input_password   s"    ""$??(??r&   c                s    \         P                  P                  4       '       * pT;'       d.    V P                  \         P                  P	                  4       4      # )z4Return password from pipe if not on TTY, else False.)rH   ZstdinZisattystrip_last_newlineZread)ZclsZis_piper3   r$   rI   ZCommandLineTool.pass_from_pipe   s=     ii&&((CC311#))..2BCCr&   c                sZ    \        V P                  R4      '       d   RMR4      pW,          # )zStrip one last newline, if present.

>>> CommandLineTool.strip_last_newline('foo')
'foo'
>>> CommandLineTool.strip_last_newline('foo\n')
'foo'
Z
Ni)ZsliceZendswith)r   Zslcr3   r$   rK   Z"CommandLineTool.strip_last_newline   s%     #,,t,,B$7xr&   )r   N)__name__Z
__module__Z__qualname__Z__firstlineno__Z__annotations__r%   r-   r(   r4   r?   r@   rB   rD   rF   rG   r   r+   r)   rE   ZclassmethodrI   ZstaticmethodrK   Z__static_attributes__r8   r&   r$   r   r      s    MNLM@(D,UA.;
<53XJ @ D D
 	 	r&   r   c                sn    V f   \         P                  R,          p \        4       pVP                  V 4      # )zMain command line interface.:i   NN)rH   r,   r   r-   )r,   Zclir3   r$   mainrM      s,     |xx|

C774=r&   Z__main__r.   )Z__doc__Z
__future__r    r   rJ   r   rH   Z r   r   r   r   r   r   r   r   r	   Zutilr
   r   rM   rL   Zexitr8   r&   r$   <module>rN      sZ    F "    

 
 
 v vr zHHTV r&   