a
    Dfd                     @  s2   d dl mZ d dlZddlmZ G dd dZdS )    )annotationsN   o8c                   @  s$   e Zd ZdZdZdd Zdd ZdS )GimpPaletteFilez'File handler for GIMP's palette format.ZRGBc                 C  s   dd t dD | _| d d dkr4d}t|t dD ]}| }|sP qtd|r^q<t|dkrvd	}t|ttt	|
 d d
 }t|d
krd}t|t|d t|d  t|d  | j|< q<d| j| _d S )Nc                 S  s   g | ]}t |d  qS )   r   ).0i r
   `/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/PIL/GimpPaletteFile.py
<listcomp>       z,GimpPaletteFile.__init__.<locals>.<listcomp>      s   GIMP Paletteznot a GIMP palette files   \w+:|#d   zbad palette filer   zbad palette entryr   r      r   )rangepalettereadlineSyntaxErrorrematchlentuplemapintsplit
ValueErrorr   join)selffpmsgr	   svr
   r
   r   __init__   s&    ,zGimpPaletteFile.__init__c                 C  s   | j | jfS )N)r   rawmode)r   r
   r
   r   
getpalette8   s    zGimpPaletteFile.getpaletteN)__name__
__module____qualname____doc__r%   r$   r&   r
   r
   r
   r   r      s   r   )
__future__r   r   _binaryr   r   r
   r
   r
   r   <module>   s   