%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/launchpadlib/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/launchpadlib/__pycache__/credentials.cpython-312.pyc

�

�ΔaZy��<�ddlmZ	eZgd�Z	ddlmZddl	Z	ddl
Z
ddlZddlmZddl
Z
ddlmZddlZ	ddlmZ	ddlmZddlZdd	lmZmZdd
lmZeeureZneZddl m!Z!ddl"m#Z$m%Z%m&Z&m'Z'dd
l(m)Z)dZ*dZ+dZ,dZ-dZ.e/e0e1fZ2d�Z3d�Z4Gd�de&�Z5Gd�de$�Z#Gd�de$�Z6Gd�de7�Z8Gd�de8�Z9Gd�d e8�Z:Gd!�d"e8�Z;Gd#�d$e7�Z<Gd%�d&e<�Z=Gd'�d(e=�Z>Gd)�d*e?�Z@Gd+�d,e@�ZAGd-�d.e@�ZBGd/�d0eB�ZCGd1�d2eB�ZDGd3�d4eD�ZEGd5�d6e@�ZFGd7�d8e@�ZGGd9�d:e@�ZHGd;�d<e@�ZIy#e$r
ddlmZY��awxYw#e$r
ddlmZY��LwxYw#e$r
ddlmZY��WwxYw)=�)�print_function)�AccessToken�AnonymousAccessToken� AuthorizeRequestTokenWithBrowser�CredentialStore�RequestTokenAuthorizationEngine�Consumer�Credentials)�StringION)�select)�stdin)�	urlencode)�urljoin)�	b64decode�	b64encode)�parse_qs)�	HTTPError)rr	�OAuthAuthorizer�SystemWideConsumer)�urisz+request-tokenz
+access-tokenz+authorize-token�i�c�T�ttjjdd��S)z�Whether the user has disabled SSL certificate connection.

    Some testing servers have broken certificates.  Rather than raising an
    error, we allow an environment variable,
    ``LP_DISABLE_SSL_CERTIFICATE_VALIDATION`` to disable the check.
    �%LP_DISABLE_SSL_CERTIFICATE_VALIDATIONF)�bool�os�environ�get���:/usr/lib/python3/dist-packages/launchpadlib/credentials.py�$_ssl_certificate_validation_disabledr!Vs����
�
���F��N�O�Orc��t�}tj|��j|d|t	|���\}}|j
dk7rt
||��||fS)z�POST to ``url`` with ``headers`` and a body of urlencoded ``params``.

    Wraps it up to make sure we avoid the SSL certificate validation if our
    environment tells us to.  Also, raises an error on non-200 statuses.
    )�"disable_ssl_certificate_validation�POST)�method�headers�body��)r!�httplib2�Http�requestr�statusr)�urlr&�params�
cert_disabled�response�contents      r �
_http_postr2csa��9�:�M� �
�
�+8��
�g�c�&�'�	�&�8I�g�J��H�g����#����'�*�*��W��rc�z�eZdZdZdZdZdZdZdZd�Z	e
d��Zdejefd	�Zejfd
�Zy)r
z�Standard credentials storage and usage class.

    :ivar consumer: The consumer (application)
    :type consumer: `Consumer`
    :ivar access_token: Access information on behalf of the user
    :type access_token: `AccessToken`
    N�uri�dictz<BR>�
c��t�}|j|�|j�}t|t�r|jd�}|S)zeTurn this object into a string.

        This should probably be moved into OAuthAuthorizer.
        �utf-8)r�save�getvalue�
isinstance�unicode_type�encode)�self�sio�
serializeds   r �	serializezCredentials.serialize�sA��
�j���	�	�#���\�\�^�
��j�,�/�#�*�*�7�3�J��rc��|�}t|t�s|jd�}|jt	|��|S)z}Create a `Credentials` object from a serialized string.

        This should probably be moved into OAuthAuthorizer.
        r8)r;r<�decode�loadr)�cls�value�credentialss   r �from_stringzCredentials.from_string�s;���e���%��.��L�L��)�E�����%��)��rc��|j�Jd��|j�Jd��tj|�}t	|jj
dd��}|tz}d|i}||jk(rd|d<t|||�\}}t|t�r|jd	�}||jk(r8tj|�}|�||d
<tj|�|_|Stj#|�|_|�t$�d|j j
��}|�||j _|d|zz
}|S)
a�Request an OAuth token to Launchpad.

        Also store the token in self._request_token.

        This method must not be called on an object with no consumer
        specified or if an access token has already been obtained.

        :param context: The context of this token, that is, its scope of
            validity within Launchpad.
        :param web_root: The URL of the website on which the token
            should be requested.
        :token_format: How the token should be
            presented. URI_TOKEN_FORMAT means just return the URL to
            the page that authorizes the token.  DICT_TOKEN_FORMAT
            means return a dictionary describing the token
            and the site's authentication policy.

        :return: If token_format is URI_TOKEN_FORMAT, the URL for the
            user to authorize the `AccessToken` provided by
            Launchpad. If token_format is DICT_TOKEN_FORMAT, a dict of
            information about the new access token.
        zConsumer not specified.zAccess token already obtained.�	PLAINTEXT�&)�oauth_consumer_key�oauth_signature_method�oauth_signature�Refererzapplication/json�Acceptr8�
lp.context�
?oauth_token=z&lp.context=%s)�consumer�access_tokenr�lookup_web_rootr5�key�request_token_page�DICT_TOKEN_FORMATr2r;�bytesrC�json�loadsr�from_params�_request_tokenrH�authorize_token_page�context)	r>r_�web_root�token_formatr.r-r&r0r1s	         r �get_request_tokenzCredentials.get_request_token�sW��8�}�}�(�C�*C�C�(�� � �(�J�*J�J�(��'�'��1���#�}�}�0�0�#.��
��
�+�+���h�'���4�1�1�1� 2�G�H��&�s�G�V�<���'��g�u�%��n�n�W�-�G��4�1�1�1��Z�Z��(�F��"�'.��|�$�"-�"9�"9�&�"A�D���M�"-�"9�"9�'�"B�D���$��#�#�'�'��C�
�"�.5��#�#�+��'�'�1�1���Jrc�^�|j�Jd��tj|�}t|jj
d|jj
d|jjz��}|tz}d|i}t|||�\}}tj|�|_y)adExchange the previously obtained request token for an access token.

        This method must not be called unless get_request_token() has been
        called and completed successfully.

        The access token will be stored as self.access_token.

        :param web_root: The base URL of the website that granted the
            request token.
        Nz5get_request_token() doesn't seem to have been called.rJz&%s)rLrM�oauth_tokenrNrO)r]rrUr5rSrV�secret�access_token_pager2rrHrT)r>r`r.r-r&r0r1s       r �'exchange_request_token_for_access_tokenz3Credentials.exchange_request_token_for_access_token�s���
���+�	C�B�	C�+��'�'��1���#�}�}�0�0�#.��+�+�/�/�!�D�$7�$7�$>�$>�>�	
���*�*���h�'��&�s�G�V�<���'�'�3�3�G�<��r)�__name__�
__module__�__qualname__�__doc__r]�URI_TOKEN_FORMATrX�ITEM_SEPARATOR�NEWLINErA�classmethodrHr�STAGING_WEB_ROOTrbrgrrr r
r
rsd����N������N��G�
��	��	���&�&�%�	;�|�,�,�=rr
c�0�eZdZdZed��Zed��Zy)rzAn OAuth access token.c�L�|d}|d}|jd�}||||�S)z:Create and return a new `AccessToken` from the given dict.rd�oauth_token_secretrQ)r)rEr.rVrer_s     r r\zAccessToken.from_params�s6���]�#���,�-���*�*�\�*���3���(�(rc�H�t|t�s|jd�}t|d��}|d}t	|�dk(sJd��|d}|d}t	|�dk(sJd	��|d}|jd
�}|�t	|�dk(sJd��|d}||||�S)z<Create and return a new `AccessToken` from the given string.r8F)�keep_blank_valuesrdrz/Query string must have exactly one oauth_token.rrsz*Query string must have exactly one secret.rQz*Query string must have exactly one context)r;r<rCr�lenr)rE�query_stringr.rVrer_s      r rHzAccessToken.from_string�s����,��5�'�.�.�w�7�L��,�%�@���]�#���3�x�1�}�O�O�O�}��!�f���,�-���6�{�a��M�!M�M�������*�*�\�*�����G���!�
<�;�
<�!��a�j�G��3���(�(rN)rhrirjrkror\rHrrr rr�s+�� ��)��)��)��)rrc�"��eZdZdZ�fd�Z�xZS)rzoAn OAuth access token that doesn't authenticate anybody.

    This token can be used for anonymous access.
    c�.��tt|�dd�y)N�)�superr�__init__)r>�	__class__s �r r|zAnonymousAccessToken.__init__s���
�"�D�2�2�r�:r)rhrirjrkr|�
__classcell__�r}s@r rrs����
;�;rrc�0�eZdZdZdd�Zd�Zd�Zd�Zd�Zy)	rz�Store OAuth credentials locally.

    This is a generic superclass. To implement a specific way of
    storing credentials locally you'll need to subclass this class,
    and implement `do_save` and `do_load`.
    Nc��||_y)aConstructor.

        :param credential_save_failed: A callback to be invoked if the
            save to local storage fails. You should never invoke this
            callback yourself! Instead, you should raise an exception
            from do_save().
        N)�credential_save_failed)r>r�s  r r|zCredentialStore.__init__&s��'=��#rc��	|j||�|S#t$r�t$r)}|j�|�|j�Yd}~|Sd}~wwxYw)z�Save the credentials and invoke the callback on failure.

        Do not override this method when subclassing. Override
        do_save() instead.
        N)�do_save�EXPLOSIVE_ERRORS�	Exceptionr�)r>rG�unique_consumer_id�es    r r9zCredentialStore.save0sa��	*��L�L��&8�9����
 �	���	*��*�*�2����'�'�)�)����		*�s��A�A�Ac��t��)z�Store newly-authorized credentials locally for later use.

        :param credentials: A Credentials object to save.
        :param unique_consumer_id: A string uniquely identifying an
            OAuth consumer on a Launchpad instance.
        ��NotImplementedError)r>rGr�s   r r�zCredentialStore.do_save@s
��"�#�#rc�$�|j|�S)a0Retrieve credentials from a local store.

        This method is the inverse of `save`.

        There's no special behavior in this method--it just calls
        `do_load`. There _is_ special behavior in `save`, and this
        way, developers can remember to implement `do_save` and
        `do_load`, not `do_save` and `load`.

        :param unique_key: A string uniquely identifying an OAuth consumer
            on a Launchpad instance.

        :return: A `Credentials` object if one is found in the local
            store, and None otherise.
        )�do_load�r>�
unique_keys  r rDzCredentialStore.loadIs�� �|�|�J�'�'rc��t��)a@Retrieve credentials from a local store.

        This method is the inverse of `do_save`.

        :param unique_key: A string uniquely identifying an OAuth consumer
            on a Launchpad instance.

        :return: A `Credentials` object if one is found in the local
            store, and None otherise.
        r�r�s  r r�zCredentialStore.do_load[s
��"�#�#r�N)	rhrirjrkr|r9r�rDr�rrr rrs ���=�� $�(�$$rrc�D��eZdZdZdZd�fd�	Zed��Zd�Zd�Z	�xZ
S)�KeyringCredentialStorez�Store credentials in the GNOME keyring or KDE wallet.

    This is a good solution for desktop applications and interactive
    scripts. It doesn't work for non-interactive scripts, or for
    integrating third-party websites into Launchpad.
    s<B64>c�`��tt|�|�d|_|rt	|�|_yyr�)r{r�r|�	_fallback�MemoryCredentialStore)r>r��fallbackr}s   �r r|zKeyringCredentialStore.__init__ss0���
�$�d�4�5K�L�����2�3I�J�D�N�rc�v�dt�vrddladt�vr	ddlmayy#t$r	t
aYywxYw)aGEnsure the keyring module is imported (postponing side effects).

        The keyring module initializes the environment-dependent backend at
        import time (nasty).  We want to avoid that initialization because it
        may do things like prompt the user to unlock their password store
        (e.g., KWallet).
        �keyringrN�NoKeyringError)r�)�globalsr��keyring.errorsr��ImportError�RuntimeErrorrrr �_ensure_keyring_importedz/KeyringCredentialStore._ensure_keyring_importedys>���G�I�%���7�9�,�
.�9�-���
.�!-��
.�s�&�8�8c�x�|j�|j�}|jt|�z}	tjd||j
d��y#t$rO}ttk(rdt|�vr�|jr|jj||�n�Yd}~yd}~wwxYw)z2Store newly-authorized credentials in the keyring.�launchpadlibr8�$No recommended backend was availableN)r�rA�	B64MARKERrr��set_passwordrCr�r��strr�r9)r>rGr�r@r�s     r r�zKeyringCredentialStore.do_save�s����%�%�'� �*�*�,�
��^�^�i�
�&;�;�
�	�� � ��
�J�,=�,=�g�,F�
���	��,�.�:�#�a�&�H���~�~����#�#�K��<��=��	�s�&A!�!	B9�*AB4�4B9c�0�|j�	tjd|�}|�vt|t�r|jd�}|j|j�r"	t|t|j�d�}	t j#|�}|Sy#t$rM}ttk(rdt|�vr�|jr |jj|�cYd}~S�d}~wwxYw#t$rYywxYw#t$$rYywxYw)z&Retrieve credentials from the keyring.r�r�N�utf8)r�r��get_passwordr�r�r�r�rDr;r<r=�
startswithr�rrv�	TypeErrorr
rHr�)r>r��credential_stringr�rGs     r r�zKeyringCredentialStore.do_load�s���%�%�'�	� '� 4� 4��
�!���(��+�\�:�$5�$<�$<�V�$D�!� �+�+�D�N�N�;� �(1�)�#�d�n�n�*=�*?�@�)�%�
�)�5�5�6G�H��"�"���A�	��,�.�:�#�a�&�H���~�~��~�~�*�*�:�6�6���	��(!� � � ���
��	
�sH�B!�'!C:�	D	�!	C7�*AC2�+C7�1C2�2C7�:	D�D�		D�D)NF)rhrirjrkr�r|�staticmethodr�r�r�r~rs@r r�r�is3�����I�K��.��.�$�2'rr�c�0��eZdZdZd�fd�	Zd�Zd�Z�xZS)�UnencryptedFileCredentialStorez�Store credentials unencrypted in a file on disk.

    This is a good solution for scripts that need to run without any
    user interaction.
    c�:��tt|�|�||_yr�)r{r�r|�filename)r>r�r�r}s   �r r|z'UnencryptedFileCredentialStore.__init__�s���
�,�d�<�"�	
�!��
rc�:�|j|j�y)zSave the credentials to disk.N)�save_to_pathr��r>rGr�s   r r�z&UnencryptedFileCredentialStore.do_save�s��� � ����/rc��tjj|j�rRtj|j�tj
dk(stj|j�Sy)zLoad the credentials from disk.rN)r�path�existsr��stat�ST_SIZEr
�load_from_pathr�s  r r�z&UnencryptedFileCredentialStore.do_load�sN��
�G�G�N�N�4�=�=�)��G�G�D�M�M�*�4�<�<�8�A�=��-�-�d�m�m�<�<�rr��rhrirjrkr|r�r�r~rs@r r�r��s����!�0�rr�c�0��eZdZdZd�fd�	Zd�Zd�Z�xZS)r�z�CredentialStore that stores keys only in memory.

    This can be used to provide a CredentialStore instance without
    actually saving any key to persistent storage.
    c�:��tt|�|�i|_yr�)r{r�r|�_credentials)r>r�r}s  �r r|zMemoryCredentialStore.__init__�s���
�#�T�3�4J�K���rc�"�||j|<y)z!Store the credentials in our dictN)r�r�s   r r�zMemoryCredentialStore.do_save�s��(3����*�%rc�8�|jj|�S)z&Retrieve the credentials from our dict)r�rr�s  r r�zMemoryCredentialStore.do_load�s��� � �$�$�Z�0�0rr�r�rs@r r�r��s�����4�1rr�c�J�eZdZdZdZ			d
d�Zed��Zd�Zd�Z	d�Z
d	�Zy)ra/The superclass of all request token authorizers.

    This base class does not implement request token authorization,
    since that varies depending on how you want the end-user to
    authorize a request token. You'll need to subclass this class and
    implement `make_end_user_authorize_token`.
    �UNAUTHORIZEDNc�$�tj|�|_tj|�|_|�
|�td��|�|�td|�d|�d���|�dg}t
|�}n
t|�}|}||_||_	|xsg|_
y)aDBase class initialization.

        :param service_root: The root of the Launchpad instance being
            used.

        :param application_name: The name of the application that
            wants to use launchpadlib. This is used in conjunction
            with a desktop-wide integration.

            If you specify this argument, your values for
            consumer_name and allow_access_levels are ignored.

        :param consumer_name: The OAuth consumer name, for an
            application that wants its own point of integration into
            Launchpad. In almost all cases, you want to specify
            application_name instead and do a desktop-wide
            integration. The exception is when you're integrating a
            third-party website into Launchpad.

        :param allow_access_levels: A list of the Launchpad access
            levels to present to the user. ('READ_PUBLIC' and so on.)
            Your value for this argument will be ignored during a
            desktop-wide integration.
        :type allow_access_levels: A list of strings.
        Nz:You must provide either application_name or consumer_name.zOYou must provide only one of application_name and consumer_name. (You provided z and z.)�DESKTOP_INTEGRATION)r�lookup_service_root�service_root�web_root_for_service_rootr`�
ValueErrorrr	rS�application_name�allow_access_levels)r>r�r��
consumer_namer�rSs      r r|z(RequestTokenAuthorizationEngine.__init__	s���@!�4�4�\�B����6�6�|�D��
��#�
�(=��L��
��'�M�,E��$�]�4��
�� �$9�"9��)�*:�;�H� �
�.�H�,�� ��
� 0���#6�#<�"�� rc�N�|jjdz|jzS)z7Return a string identifying this consumer on this host.�@)rSrVr�)r>s r r�z2RequestTokenAuthorizationEngine.unique_consumer_idIs$���}�}� � �3�&��):�):�:�:rc��t�d|��}d}t|j�dkDr!|||j|j�zz
}t	|j
|�S)z�Return the authorization URL for a request token.

        This is the URL the end-user must visit to authorize the
        token. How exactly does this happen? That depends on the
        subclass implementation.
        rRz&allow_permission=r)r^rvr��joinrr`)r>�
request_token�page�allow_permissions    r �authorization_urlz1RequestTokenAuthorizationEngine.authorization_urlNsc��';�M�J��/���t�'�'�(�1�,��$�'7�'<�'<��(�(�(��
�D��t�}�}�d�+�+rc��|j|�}|j||�|j�y|j||j�|S)adAuthorize a token and associate it with the given credentials.

        If the credential store runs into a problem storing the
        credential locally, the `credential_save_failed` callback will
        be invoked. The callback will not be invoked if there's a
        problem authorizing the credentials.

        :param credentials: A `Credentials` object. If the end-user
            authorizes these credentials, this object will have its
            .access_token property set.

        :param credential_store: A `CredentialStore` object. If the
            end-user authorizes the credentials, they will be
            persisted locally using this object.

        :return: If the credentials are successfully authorized, the
            return value is the `Credentials` object originally passed
            in. Otherwise the return value is None.
        N)rb�make_end_user_authorize_tokenrTr9r�)r>rG�credential_store�request_token_strings    r �__call__z(RequestTokenAuthorizationEngine.__call__]sQ��( $�5�5�k�B���*�*�;�8L�M��#�#�+�����k�4�+B�+B�C��rc�b�|j|jtj��}|dS)z\Get a new request token from the server.

        :param return: The request token.
        )r`rard)rbr`r
rX)r>rG�authorization_jsons   r rbz1RequestTokenAuthorizationEngine.get_request_token{s6��
)�:�:��]�]��1N�1N�;�
��"�-�0�0rc��t��)a5Authorize the given request token using the given credentials.

        Your subclass must implement this method: it has no default
        implementation.

        Because an access token may expire or be revoked in the middle
        of a session, this method may be called at arbitrary points in
        a launchpadlib session, or even multiple times during a single
        session (with a different request token each time).

        In most cases, however, this method will be called at the
        beginning of a launchpadlib session, or not at all.
        r�)r>rGr�s   r r�z=RequestTokenAuthorizationEngine.make_end_user_authorize_token�s
��"�#�#r�NNN)rhrirjrk�UNAUTHORIZED_ACCESS_LEVELr|�propertyr�r�r�rbr�rrr rr�sH���!/��
�� �>=�@�;��;�
,��<1�$rrc�6�eZdZdZdZdZd�Zd�Zd�Zd�Z	d�Z
y	)
�AuthorizeRequestTokenWithURLz�Authorize using a URL.

    This authorizer simply shows the URL for the user to open for
    authorization, and waits until the server responds.
    z�Please open this authorization page:
 (%s)
in your browser. Use your browser to authorize
this program to access Launchpad on your behalf.z.Press Enter after authorizing in your browser.c��t|�y)z�Display a message.

        By default, prints the message to standard output. The message
        does not require any user interaction--it's solely
        informative.
        N)�print)r>�messages  r �outputz#AuthorizeRequestTokenWithURL.output�s��	�g�rc�@�|j|j|z�y)�Notify the end-user of the URL.N)r��WAITING_FOR_USER)r>r�s  r �!notify_end_user_authorization_urlz>AuthorizeRequestTokenWithURL.notify_end_user_authorization_url�s�����D�)�)�,=�=�>rc�\�	|j|j�|jduS#t$rw}|jjdk(rt|j��|jjdk7rtd�t|�t|j��d}~wwxYw)z Check if the end-user authorizedi�i�z#Unexpected response from Launchpad:N)
rgr`rr0r,�EndUserDeclinedAuthorizationr1r��EndUserNoAuthorizationrT)r>rGr�s   r �check_end_user_authorizationz9AuthorizeRequestTokenWithURL.check_end_user_authorization�s���
	8��?�?��
�
�N��'�'�t�3�3���	8��z�z� � �C�'�3�1�9�9�=�=��:�:�$�$��+��?�@��!�H�,�Q�Y�Y�7�7��	8�s�+�	B+�A2B&�&B+c��|j|j�tj�|j	|�y)�"Wait for the end-user to authorizeN)r��WAITING_FOR_LAUNCHPADr
�readliner�)r>rGs  r �wait_for_end_user_authorizationz<AuthorizeRequestTokenWithURL.wait_for_end_user_authorization�s,�����D�.�.�/�
�����)�)�+�6rc�j�|j|�}|j|�|j|�y)z2Have the end-user authorize the token using a URL.N)r�r�r�)r>rGr�r�s    r r�z:AuthorizeRequestTokenWithURL.make_end_user_authorize_token�s0�� �2�2�=�A���.�.�/@�A��,�,�[�9rN)rhrirjrkr�r�r�r�r�r�r�rrr r�r��s3���	;��M���?�4�$7�:rr�c�N��eZdZdZdZdZdZdZdZ			d
�fd�	Z	�fd�Z
d	�Z�xZS)raSAuthorize using a URL that pops-up automatically in a browser.

    This authorizer simply opens up the end-user's web browser to a
    Launchpad URL and lets the end-user authorize the request token
    themselves.

    This is the same as its superclass, except this class also
    performs the browser automatic opening of the URL.
    z�The authorization page:
 (%s)
should be opening in your browser. Use your browser to authorize
this program to access Launchpad on your behalf.z/Press Enter to continue or wait (%d) seconds...�)zwww-browser�links�links2�lynx�elinkszelinks-lite�netrik�w3mz5Waiting to hear from Launchpad about your decision...c�2��tt|�||d|�y)aoConstructor.

        :param service_root: See `RequestTokenAuthorizationEngine`.
        :param application_name: See `RequestTokenAuthorizationEngine`.
        :param consumer_name: The value of this argument is
            ignored. If we have the capability to open the end-user's
            web browser, we must be running on the end-user's computer,
            so we should do a full desktop integration.
        :param credential_save_failed: See `RequestTokenAuthorizationEngine`.
        :param allow_access_levels: The value of this argument is
            ignored, for the same reason as consumer_name.
        N)r{rr|)r>r�r�r�r�r�r}s      �r r|z)AuthorizeRequestTokenWithBrowser.__init__�s ���.	�.��>��*�D�2H�	
rc���tt|�|�	tj�}t|dd�}||jv}|r_|j|j|jz�ttggg|j�\}}}|rtj�|�tj|�yy#tj$rd}d}Y��wxYw)r��basenameNF)r{rr��
webbrowserr�getattr�TERMINAL_BROWSERS�Errorr��TIMEOUT_MESSAGE�TIMEOUTrr
r��open)r>r��browser_obj�browser�console_browser�rlist�_r}s       �r r�zBAuthorizeRequestTokenWithBrowser.notify_end_user_authorization_url
s����
�,�d�	,�,=�
>�	$�$�.�.�*�K��k�:�t�<�G�%��)?�)?�?�O�
��K�K��,�,�t�|�|�;�<�!�%��"�b�$�,�,�?�K�E�1�a����� ��"��O�O�-�.�#�����	$��K�#�O�	$�s�/B?�?C�Cc�n�|j|j�tj�}|j�ktjt
�	|j
|�ry	tj�|tzk\rtdtz��|j��jyy#t$rY�JwxYw)r�NzTimed out after %d seconds.)
r�r��timerT�sleep�access_token_poll_timer�r��access_token_poll_timeout�TokenAuthorizationTimedOut)r>rG�
start_times   r r�z@AuthorizeRequestTokenWithBrowser.wait_for_end_user_authorization&s������D�.�.�/��Y�Y�[�
��&�&�.��J�J�-�.�
��4�4�[�A��B��y�y�{�j�+D�D�D�0�1�4M�M����&�&�.��
*�
��
�s�B(�(	B4�3B4r�)
rhrirjrkr�rrr�r�r|r�r�r~rs@r rr�sL����	;��H�O��G�	��	@���#� �

�6/�2rrc��eZdZy)�TokenAuthorizationExceptionN�rhrirjrrr rr7���rrc��eZdZy)�RequestTokenAlreadyAuthorizedNrrrr rr;rrrc��eZdZdZy)�EndUserAuthorizationFailedz?Superclass exception for all failures of end-user authorizationN�rhrirjrkrrr rr?s��I�rrc��eZdZdZy)r�zEnd-user declined authorizationNrrrr r�r�Es��)�rr�c��eZdZdZy)r�z*End-user did not perform any authorizationNrrrr r�r�Ks��4�rr�c��eZdZdZy)rz<End-user did not perform any authorization in timeout periodNrrrr rrQs��F�rrc��eZdZy)�ClientErrorNrrrr rrWrrrc��eZdZy)�ServerErrorNrrrr rr[rrrc��eZdZy)�NoLaunchpadAccountNrrrr r!r!_rrr!c��eZdZy)�TooManyAuthenticationFailuresNrrrr r#r#crrr#)J�
__future__r�type�
__metaclass__�__all__�	cStringIOrr��ior)rZrrr��sysr
r
�urllib.parser�urllibr�urlparser��base64rr�six.moves.urllib.parserrYr��unicoder<�lazr.restfulclient.errorsr�"lazr.restfulclient.authorize.oauthr�_AccessTokenr	rrr�rrWrfr^rr
�MemoryError�KeyboardInterrupt�
SystemExitr�r!r2r
r�objectrr�r�r�rr�rr�rrrr�r�rrrr!r#rrr �<module>r8s��"&�:��
����"���	�����!�&�!�$���
,��C�<��L��L�/����%��#��)����#���!2�J�?��
P��=�/�=�D)�,�)�@;�<�;�H$�f�H$�Vc�_�c�L�_��61�O�1�(U$�f�U$�p8:�#B�8:�vc�'C�c�L	�)�	�	�$?�	�	�!<�	�	�#=�	�	�7�	�	�!7�	�	�-�	�	�-�	�	�4�	�	�$?�	��C�������!� � �!���!� � �!�s3�E(�E:�F�(E7�6E7�:F	�F	�F�F

Zerion Mini Shell 1.0