§
    cÌc  ã                   óà   — d Z ddlmZmZmZ ddlmZmZ ddlm	Z	 dZ
 G d„ dej        ¦  «        Z G d„ d	ej        ¦  «        Z G d
„ dej        ¦  «        Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„ZdS )z·Functions to manage the user's Launchpad user ID.

This allows the user to configure their Launchpad user ID once, rather
than once for each place that needs to take it into account.
é   )ÚerrorsÚtraceÚ	transport)ÚAuthenticationConfigÚGlobalStack)Úgettextzhttps://launchpad.net/c                   ó   — e Zd ZdZdS )ÚUnknownLaunchpadUsernamez6The user name %(user)s is not registered on Launchpad.N©Ú__name__Ú
__module__Ú__qualname__Ú_fmt© ó    úB/usr/lib/python3/dist-packages/breezy/plugins/launchpad/account.pyr
   r
   "   s   € € € € € ØC€D€D€Dr   r
   c                   ó   — e Zd ZdZdS )ÚNoRegisteredSSHKeyszhThe user %(user)s has not registered any SSH keys with Launchpad.
See <https://launchpad.net/people/+me>Nr   r   r   r   r   r   &   s   € € € € € ð1€D€D€Dr   r   c                   ó   — e Zd ZdZdS )ÚMismatchedUsernameszjbreezy.conf and authentication.conf disagree about launchpad account name.  Please re-run launchpad-login.Nr   r   r   r   r   r   +   s   € € € € € ð=€D€D€Dr   r   Nc                 ó  — | €t          ¦   «         } |                      d¦  «        }|�et          ¦   «         }t          |¦  «        }|€2t	          j        t          d¦  «        ¦  «         t          ||¦  «         n||k    rt          ¦   «         ‚|S )z“Return the user's Launchpad username.

    :raises: MismatchedUsername if authentication.conf and breezy.conf
        disagree about username.
    NÚlaunchpad_usernamez-Setting ssh/sftp usernames for launchpad.net.)	r   Úgetr   Ú_get_auth_userr   Únoter   Ú_set_auth_userr   )Ú_configÚusernameÚauthÚauth_usernames       r   Úget_lp_loginr!   1   s�   € ð €Ý‘-”-ˆà�{Š{Ð/Ñ0Ô0€HØÐÝ#Ñ%Ô%ˆÝ& tÑ,Ô,ˆàÐ ÝŒJ•wÐNÑOÔOÑPÔPÐPÝ˜8 TÑ*Ô*Ð*Ð*Ø˜hÒ&Ð&Ý%Ñ'Ô'Ð'Ø€Or   c                 ó„   — |€t          ¦   «         }| €|                     d¦  «         d S |                     d| ¦  «         d S )Nr   )r   ÚremoveÚset©r   r   s     r   Ú_set_global_optionr&   G   sJ   € Ø€Ý‘-”-ˆØÐØ�ŠÐ+Ñ,Ô,Ð,Ð,Ð,à�ŠÐ(¨(Ñ3Ô3Ð3Ð3Ð3r   c                 óL   — t          | |¦  «         | �t          | ¦  «         dS dS )z!Set the user's Launchpad usernameN)r&   r   r%   s     r   Úset_lp_loginr(   P   s4   € å�x Ñ)Ô)Ð)ØÐÝ�xÑ Ô Ð Ð Ð ð Ðr   c                 óR   — | €t          ¦   «         } |                      dd¦  «        }|S )NÚsshú.launchpad.net)r   Úget_user)r   r   s     r   r   r   W   s+   € Ø€|Ý#Ñ%Ô%ˆØ�}Š}˜UÐ$4Ñ5Ô5€HØ€Or   c                 óV   — |€t          ¦   «         }|                     dd| d¦  «         d S )NÚ	Launchpadr+   r*   )r   Úset_credentials)r   r   s     r   r   r   ^   s>   € Ø€|Ý#Ñ%Ô%ˆØ×ÒØÐ% x°ñ8ô 8ð 8ð 8ð 8r   c                 óÚ   — |€t          j        t          ¦  «        }	 |                     d| z  ¦  «        }n## t           j        $ r t          | ¬¦  «        ‚w xY w|st          | ¬¦  «        ‚dS )z�Check whether the given Launchpad username is okay.

    This will check for both existence and whether the user has
    uploaded SSH keys.
    Nz~%s/+sshkeys)Úuser)r   Úget_transport_from_urlÚLAUNCHPAD_BASEÚ	get_bytesÚ
NoSuchFiler
   r   )r   Ú
_transportÚdatas      r   Úcheck_lp_loginr8   e   s�   € ð ÐÝÔ5µnÑEÔEˆ
ð6Ø×#Ò# N°XÑ$=Ñ>Ô>ˆˆøÝÔð 6ð 6ð 6Ý&¨HÐ5Ñ5Ô5Ð5ð6øøøð ð 1Ý! xÐ0Ñ0Ô0Ð0ð1ð 1s	   �6 ¶ A)N)Ú__doc__Ú r   r   r   Úconfigr   r   Úi18nr   r3   ÚBzrErrorr
   r   r   r!   r&   r(   r   r   r8   r   r   r   ú<module>r>      s€  ðð"ð ðð ð ð ð ð ð ð ð ð ð
 8Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ø Ð Ð Ð Ð Ð à)€ðDð Dð Dð Dð D˜vœñ Dô Dð Dð1ð 1ð 1ð 1ð 1˜&œ/ñ 1ô 1ð 1ð
>ð >ð >ð >ð >˜&œ/ñ >ô >ð >ðð ð ð ð,4ð 4ð 4ð 4ð!ð !ð !ð !ðð ð ð ð8ð 8ð 8ð 8ð1ð 1ð 1ð 1ð 1ð 1r   