o
    ˷e                     @   sN   d dl mZ d dlmZ d dlmZ G dd deZG dd deZegZdS )	    )STORE_TOKENS)ProviderAccount)OAuth2Providerc                       s,   e Zd Zdd Zdd Z fddZ  ZS )EveOnlineAccountc                 C   s   dj | jjddS )Nz.https://gate.eveonline.com/Profile/{char_name}CharacterName)	char_nameformataccount
extra_datagetself r   i/var/www/ideatree/venv/lib/python3.10/site-packages/allauth/socialaccount/providers/eveonline/provider.pyget_profile_url   s   z EveOnlineAccount.get_profile_urlc                 C   s   dj | jjdddS )Nz7https://image.eveonline.com/Character/{char_id}_128.jpgCharacterID   )char_idr   r   r   r   r   get_avatar_url   s   zEveOnlineAccount.get_avatar_urlc                    s>   t t|  }tdd | jjdd | jjdd |fD S )Nc                 s   s    | ]	}|d ur|V  qd S )Nr   ).0valuer   r   r   	<genexpr>   s    z*EveOnlineAccount.to_str.<locals>.<genexpr>r   r   )superr   to_strnextr
   r   r   )r   dflt	__class__r   r   r      s   zEveOnlineAccount.to_str)__name__
__module____qualname__r   r   r   __classcell__r   r   r   r   r      s    r   c                   @   s0   e Zd ZdZdZeZdd Zdd Zdd Z	d	S )
EveOnlineProvider	eveonlinez
EVE Onlinec                 C   s   g }t r	|d |S )N
publicData)r   append)r   scopesr   r   r   get_default_scope#   s   
z#EveOnlineProvider.get_default_scopec                 C   s   t |d S )NCharacterOwnerHash)strr   datar   r   r   extract_uid)   s   zEveOnlineProvider.extract_uidc                 C   s   t |ddS )Nr   )name)dictr   r+   r   r   r   extract_common_fields,   s   z'EveOnlineProvider.extract_common_fieldsN)
r   r    r!   idr.   r   account_classr(   r-   r0   r   r   r   r   r#      s    r#   N)	"allauth.socialaccount.app_settingsr   $allauth.socialaccount.providers.baser   /allauth.socialaccount.providers.oauth2.providerr   r   r#   provider_classesr   r   r   r   <module>   s    
