� C�g���L�ddlmZddlZddlmZddlmZGd�d��ZdS)�)� annotationsN)�IO���o8c�&�eZdZdZdZd d�Zd d �Zd S) �GimpPaletteFilez'File handler for GIMP's palette format.�RGB�fp� IO[bytes]�return�Nonec ���d�td��D��}|���dd�dkrd}t|���td��D]�}|���}|sn�tjd|��r�0t |��dkrd}t|���t tt|� ��dd �����}t |��d krd }t|���t|d ��t|d ��zt|d ��z||<��d� |��|_ dS)Nc�2�g|]}t|��dz��S)�r)�.0�is �c/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/PIL/GimpPaletteFile.py� <listcomp>z,GimpPaletteFile.__init__.<locals>.<listcomp>s"��1�1�1��2�a�5�5�1�9�1�1�1��� s GIMP Paletteznot a GIMP palette files\w+:|#�dzbad palette filerzbad palette entryrr�r)�range�readline� SyntaxError�re�match�len�tuple�map�int�split� ValueErrorr�join�palette)�selfr r'�msgr�s�vs r�__init__zGimpPaletteFile.__init__sE��1�1�e�C�j�j�1�1�1�� �;�;�=�=��"�� �� 0� 0�+�C��c�"�"� "��s��� 8� 8�A�� � � � �A�� ����x� �A�&�&� ���1�v�v��|�|�(��!�#�&�&�&��c�#�q�w�w�y�y��!��}�-�-�.�.�A��1�v�v��{�{�)�� ��o�o�%��A�a�D���B�q��t�H�H�,�r�!�A�$�x�x�7�G�A�J�J��x�x��(�(�� � � r�tuple[bytes, str]c��|j|jfS)N)r'�rawmode)r(s r� getpalettezGimpPaletteFile.getpalette9s���|�T�\�)�)rN)r r r r)r r-)�__name__� __module__� __qualname__�__doc__r/r,r0�rrr r sG������1�1��G�)�)�)�)�8*�*�*�*�*�*rr )� __future__rr�typingr�_binaryrr r5rr�<module>r9sx�� #�"�"�"�"�"� � � � �������������"*�"*�"*�"*�"*�"*�"*�"*�"*�"*r
Memory