Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
GimpPaletteFile.cpython-313.pyc17 linesDownload Raw Back to __pycache__
1�

2v�j���V�SSKJr SSKrSSKJr Sr\(aSSKJr "SS5rg)�)�annotationsN)�BytesIOF)�IOc�R�\rSrSrSrSrS3SSjjrSSjr\S
Sj5r	SSjr4Srg	)�GimpPaletteFile�z'File handler for GIMP's palette format.�RGBc�"^�UR5RS5(d
Sn[U5e/nSnU(aUS:XaO�US-
nUR5nU(dO�[R"SU5(aMJU(a[U5S:�a
Sn[U5eUR
S	S59m[T5S	:a
Sn[U5eUU4Sj[S	55-
nU(a[U5S
:XaOM�[U5Ul6g)NsGIMP Paletteznot a GIMP palette fileri�s\w+:|#�dzbad palette file�)�maxsplitzbad palette entryc3�@># �UHn[TU5v� M g7f�N)�int)�.0�i�vs  ��YD:\code\apps\devtools\python\user_packages\Python313\site-packages\PIL/GimpPaletteFile.py�	<genexpr>�(GimpPaletteFile._read.<locals>.<genexpr>;s����4�8�a��A�a�D�	�	�8�s�i)�readline�7startswith�SyntaxError�re�match�len�split�8ValueError�range�bytes�palette)�self�fp�limit�msgr"r�srs       @r�_read�GimpPaletteFile._reads�����{�{�}�'�'��8�8�+�C��c�"�"���
�����g���
��F�A����
�A����x�x�9�A�&�&����Q��#��(��!�#�&�&������#�A��1�v��z�)�� ��o�%��4�5��8�4�4�G���W���,��/�2�W�~���c�&�URU5 gr)r()r#r$s  r�__init__�GimpPaletteFile.__init__As
���10�11�2�r*c�^�URU5nUR[U5S5 U$)NF)�__new__r(r)�cls�datar#s   r�	frombytes�GimpPaletteFile.frombytesDs'���{�{�3����12�13�7�4�=�%�(��r*c�2�URUR4$r)r"�rawmode)r#s r�14getpalette�GimpPaletteFile.getpaletteJs���|�|�T�\�\�)�)r*)r"N)T)r$�	IO[bytes]r%�bool�return�None)r$r8r:r;)r1r!r:r)r:ztuple[bytes, str])�__name__�15__module__�__qualname__�__firstlineno__�__doc__r5r(r,�classmethodr2r6�__static_attributes__�r*rrrs.��1��G� &�D�����16*r*r)	�17__future__rr�ior�
TYPE_CHECKING�typingrrrCr*r�<module>rHs%�� #�	���
���1*�1*r*
codekingpro/portable-devtools · Team Ai