o
    œÀvhÆ  ã                   @   sZ  zd dl mZmZmZmZmZmZmZmZm	Z	 W n; e
yS   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d dl	Z	W n e
yP   e
dƒ‚w Y nw zd dlmZ W n6 e
y’ Z z*zd dlmZ W n e
y‡   zd dlmZ W n	 e
y„   e‚w Y nw W Y dZ[ndZ[ww zeegZW n ey¥   egZY nw ddd„ZdS )	é    )	ÚImageÚ
ImageColorÚ
ImageChopsÚImageEnhanceÚ	ImageFileÚImageFilterÚ	ImageDrawÚ	ImageStatÚ	ImageModeNz€PILKit was unable to import the Python Imaging Library. Please confirm it`s installed and available on your current Python path.)ÚBytesIO)ÚStringIOc                 C   s°   |  d¡}| }t|ƒD ]J\}}zt||ƒ}W q tyU   d |d|d … ¡}|du r7td t| ƒj|¡ƒ‚z
t| |ƒW  Y   S  tyT   td t| ƒj||¡ƒ‚w w |S )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Úmissing© r    úH/var/www/html/hyperkenya/venv/lib/python3.10/site-packages/pilkit/lib.pyr   '   s    
ÿù	r   )N)ÚPILr   r   r   r   r   r   r   r	   r
   ÚImportErrorÚior   r   ÚexcÚ	cStringIOÚ
basestringÚstrÚstring_typesÚ	NameErrorr   r    r    r    r!   Ú<module>   sN   0ÿÿöÿÿþ€ý	
ÿ