a
    xd                     @   s(   d dl Z d dlmZ G dd deZdS )    N)messagec                   @   s*   e Zd ZdZdZdZdd ZdddZdS )	ExtensionzAn interface for OpenID extensions.

    @ivar ns_uri: The namespace to which to add the arguments for this
        extension
    Nc                 C   s
   t  dS )a~  Get the string arguments that should be added to an OpenID
        message for this extension.

        @returns: A dictionary of completely non-namespaced arguments
            to be added. For example, if the extension's alias is
            'uncle', and this method returns {'meat':'Hot Rats'}, the
            final message will contain {'openid.uncle.meat':'Hot Rats'}
        N)NotImplementedError)self r   H/var/www/html/Ranjet/env/lib/python3.9/site-packages/openid/extension.pygetExtensionArgs   s    	zExtension.getExtensionArgsc                 C   s   |du r$t jdtdd ttj}| }z|jj| j	| j
|d W n( tyn   |j| j	| j
krj Y n0 || j	|   |S )zAdd the arguments from this extension to the provided
        message, or create a new message containing only those
        arguments.

        @returns: The message with the extension arguments added
        NzaPassing None to Extension.toMessage is deprecated. Creating a message assuming you want OpenID 2.   )
stacklevel)implicit)warningswarnDeprecationWarningmessage_moduleMessageZ
OPENID2_NSZ	isOpenID1
namespacesZaddAliasns_urins_aliasKeyErrorZgetAliasZ
updateArgsr   )r   r   r   r   r   r   	toMessage   s"    

zExtension.toMessage)N)__name__
__module____qualname____doc__r   r   r   r   r   r   r   r   r      s
   r   )r   Zopenidr   r   objectr   r   r   r   r   <module>   s   