
    /~h                     b   	 d dl mZmZmZmZmZmZmZmZm	Z	 	 d dlmZ 	 eegZddZy# e
$ r: 	 d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	n# e
$ r	  e
d      w xY wY Ow xY w# e
$ r0Z	 d dlmZ n# e
$ r 	 d dlmZ n# e
$ r ew xY wY nw xY wY dZ[|dZ[ww xY w# e$ r egZY w xY w)    )	Image
ImageColor
ImageChopsImageEnhance	ImageFileImageFilter	ImageDraw	ImageStat	ImageModeNzPILKit was unable to import the Python Imaging Library. Please confirm it`s installed and available on your current Python path.)BytesIO)StringIOc           
         |j                  d      }| }t        |      D ]  \  }}	 t        ||      } |S # t        $ r dj	                  |d|dz          }|.t        dj                  t        |       j                  |            	 t        | |      cY c S # t        $ r0 t        dj                  t        |       j                  ||            w xY ww xY w)a  Similar to getattr but accept dotted path

    The idea of this function is to pass dotted path to attribute.
    If the path is missing then the fallback will be evaluated as dotted path also.
    If the fallback is not present then the attribute error for the first path is thrown

    The main idea of this function is for compatibility with Pillow < 10

    Example::

        >>> from PIL import Image
        >>> getattrsafe(Image, 'Transpose.FLIP_HORIZONTAL', 'FLIP_HORIZONTAL')
    .N   z!'{}' object has no attribute '{}'z)'{}' object has no attribute '{}' or '{}')	split	enumerategetattrAttributeErrorjoinformattype__name__getattrsafe)objattrfallback_attrnamesresinamemissings           S/var/www/peopleoo.sandbox-dev.co.uk/venv/lib/python3.12/site-packages/pilkit/lib.pyr   r   '   s     JJsOE
CU# I4
	I#t$CI J  	IhhuVa!e}-G$$%H%O%OPTUXPYPbPbdk%lmmI&sM::% I()T)[)[\`ad\e\n\npw  zG  *H  I  II	Is"   6ACBC9CC)N)PILr   r   r   r   r   r   r	   r
   r   ImportErrorior   r   exc	cStringIO
basestringstrstring_types	NameErrorr        r"   <module>r.      s   
^9 9 9 	&$L
?  ^^ ^  ]  ^  	^^ 	^   & 	) 	I	 *  5Ls   ) A+ B# A($AA(A""A('A(+B 1A87B8B>BBBBBBBB #B.-B.