o
    hR                     @   s   d dl mZ G dd dZdS )   )o8c                   @   s$   e Zd ZdZdZdd Zdd ZdS )PaletteFilez-File handler for Teragon-style palette files.RGBc                 C   s   dd t dD | _	 | }|snR|dd dkrq
t|dkr%td	d
d | D }z|\}}}}W n tyG   |\}}| }}Y nw d|  krRdkrcn nt|t| t| | j|< qd| j| _d S )Nc                 S   s   g | ]}|||fqS  r   ).0ir   r   W/var/www/html/magazine_api/magazine_env/lib/python3.10/site-packages/PIL/PaletteFile.py
<listcomp>   s    z(PaletteFile.__init__.<locals>.<listcomp>   T    r      #d   zbad palette filec                 S   s   g | ]}t |qS r   )int)r   xr   r   r   r	   '   s           )	rangepalettereadlinelenSyntaxErrorsplit
ValueErrorr   join)selffpsvr   rgbr   r   r   __init__   s(   zPaletteFile.__init__c                 C   s   | j | jfS )N)r   rawmode)r   r   r   r   
getpalette3   s   zPaletteFile.getpaletteN)__name__
__module____qualname____doc__r"   r!   r#   r   r   r   r   r      s
    r   N)_binaryr   r   r   r   r   r   <module>   s   