
    Yh"                     ^    d dl Z d dlZ	 e d Zd Zd Zd Zd Z	d Z
d Zy# e$ r eZY w xY w)	    Nc                     ddl m}  ||       )Nr   )DistutilsSetupError)cffi._shimmed_dist_utilsr   )msgr   s     d/var/www/django-portfolio.reubendavern.link/venv/lib/python3.12/site-packages/cffi/setuptools_ext.pyerrorr   
   s    <
c
""    c                     t        |       5 }|j                         }d d d        dz  }t        || d      }t        |||       y # 1 sw Y   )xY w)N
exec)openreadcompiler   )filenameglobfsrccodes        r   execfiler      sP     
h 1ffh4KC3&)DtT	 s   AAc                    ddl m} t        |t              s!t	        dt        |      j                         t        |      }	 |j                  d      \  }}t        j                  j                        sRd}|j                  dd      d	z   }t        j                  j                  |      rd
|dz   z   d}t	        |d|       d|d}t        ||       	 |   }t        |      s |       }t        ||      s$t	        |dt        |      j                  d       t!        |d      st	        |d       |j"                  \  }	}
}}|j$                  r!|j'                         }|j)                  |       |
t+        | ||	       y t-        | ||	|
||       y # t        $ r t	        |d       Y ^w xY w# t        $ r t	        |dd       Y w xY w)Nr   )FFIzCargument to 'cffi_modules=...' must be a str or a list of str, not :z1 must be of the form 'path/build.py:ffi_variable' ./.pyz (rewrite cffi_modules to [z])z does not name an existing file__cffi__)__name____file__z	: object z not found in modulez is not an FFI instance (got )_assigned_sourcez(: the set_source() method was not called)cffi.apir   
isinstance
basestringr   typer   strsplit
ValueErrorospathexistsreplacer   KeyErrorhasattrr!   _windows_unicodecopy_apply_windows_unicode_add_py_module_add_c_module)distmod_specr   build_file_nameffi_var_nameext	rewrittenmod_varsffimodule_namesourcesource_extensionkwdss                r   add_cffi_moduler@      s   h
+>225 	68}H(0s(;% 77>>/*#++C5=	77>>)$C,.1CLM&ODH_h'D|$ c3ec3h6:3i6H6HJ 	K3*+hHI252F2F/K)4
yy{""4(~tS+.dCf6FME   	   DX5AC 	DDs$   F F: F76F7:GGc                     ddl m} d|vrTt        t        d      sD|j                  r8ddl}	 t        |j                  j                  d      d         }|dk\  rd|d<   |S |S # t        $ r	 d|d<   Y |S w xY w)	a7  
    Add py_limited_api to kwds if setuptools >= 26 is in use.
    Do not alter the setting if it already exists.
    Setuptools takes care of ignoring the flag on Python 2 and PyPy.

    CPython itself should ignore the flag in a debugging version
    (by not listing .abi3.so in the extensions it supports), but
    it doesn't so far, creating troubles.  That's why we check
    for "not hasattr(sys, 'gettotalrefcount')" (the 2.7 compatible equivalent
    of 'd' not in sys.abiflags). (http://bugs.python.org/issue28401)

    On Windows, with CPython <= 3.4, it's better not to use py_limited_api
    because virtualenv *still* doesn't copy PYTHON3.DLL on these versions.
    Recently (2020) we started shipping only >= 3.5 wheels, though.  So
    we'll give it another try and set py_limited_api on Windows >= 3.5.
    r   
recompilerpy_limited_apigettotalrefcountNr      T)
cffirC   r.   sysUSE_LIMITED_API
setuptoolsint__version__	partitionr(   )	Extensionr?   rC   rJ   setuptools_major_versions        r   _set_py_limited_apirP   I   s    "  $WS:L-M**	*'*:+A+A+K+KC+PQR+S'T$'2-)-%& K4K  	* &*D!"K	*s   1A! !A32A3c           	        
 ddl m} ddlm}mm ddlm dg}|j                  |j                  dg              t        ||      } |d|d|dfd	| j                  g | _        | j                  j                         | j                  j                  d	|      
 G 
fd
d
      }	|	| j                  d	<   y )Nr   	build_ext)rN   logmkpathrB   $PLACEHOLDERsources)namerW   c                     t         j                  j                  | z         }j                  d|z          |        |	 |       	j	                  
|      }|sj                  d       |S Nzgenerating cffi module %rzalready up-to-date)r)   r*   joininfomake_c_source)tmpdirpre_runc_fileupdatedr8   r;   rT   rU   r<   rC   r=   r>   s       r   make_modz_add_c_module.<locals>.make_modu   ss    fk4D&DE,v56v
 C**3VVLHH)*r	   rS   c                       e Zd Z fdZy))_add_c_module.<locals>.build_ext_make_modc                     j                   d   dk(  r-t        | dd       } | j                  |      j                   d<   j                  |        y )Nr   rV   r_   )rW   getattr
build_temprun)selfr_   
base_classr8   rb   s     r   rh   z-_add_c_module.<locals>.build_ext_make_mod.run   sE    {{1~/!$	48!)$//7!CANN4 r	   Nr   
__module____qualname__rh   )rj   r8   rb   s   r   build_ext_make_modrd      s    	!r	   rn    N)setuptools.command.build_extrS   r   rN   rT   rU   rG   rC   extendpoprP   ext_modulesappendcmdclassget)r4   r;   r<   r=   r>   r?   rS   rN   
allsourcesrn   rj   r8   rT   rb   rU   rC   s    ````     @@@@@@r   r3   r3   j   s    6?? !Jdhhy"-.y$/D

Aj
AD
AC  C "";	:J! !Z ! "4DMM+r	   c                   	
 ddl m} ddlm} ddlm
m ddlm 
fd	| j                  j                  d|       G 	fdd	      }|| j                  d<   | j                  g | _        | j                  j                         | j                  j                  d
|       G 	fdd      }|| j                  d
<   y )Nr   )build_pyrR   )rT   rU   rB   c                     j                  d| z          t        j                  j                  |              j	                  |       }|sj                  d       y y rZ   )r\   r)   r*   dirnamemake_py_source)py_filera   r;   rT   rU   r<   rC   s     r   generate_modz$_add_py_module.<locals>.generate_mod   sS    ,w67rwww'(++CgFHH)* r	   rz   c                   (    e Zd Z fdZ fdZy))_add_py_module.<locals>.build_py_make_modc                     j                  |        j                  d      }|dxx   dz  cc<    t        j                  j                  | j
                  g|        y )Nr   r   )rh   r'   r)   r*   r[   	build_lib)ri   module_pathrj   r   r<   s     r   rh   z-_add_py_module.<locals>.build_py_make_mod.run   sK    NN4 %++C0KOu$OdnnC{CDr	   c                     | j                   }	 |r|D cg c]	  }|k7  r| c}| _         j                  |       || _         S c c}w # || _         w xY wrp   )
py_modulesget_source_files)ri   saved_py_modulesmrj   r<   s      r   r   z:_add_py_module.<locals>.build_py_make_mod.get_source_files   s]      $3#2B '>Q,-,< () '>DO!2248"2	'> #3s   A AA A 	AN)r   rl   rm   rh   r   )rj   r   r<   s   r   build_py_make_modr      s    	E

	3r	   r   rS   c                       e Zd Z fdZy)*_add_py_module.<locals>.build_ext_make_modc                 ,   j                  |        | j                  rvj                  d      }dj                  |d d       }| j	                  d      }|j                  |      }|d   dz   } t        j                  j                  ||             y y )Nr   r   rz   r   )rh   inplacer'   r[   get_finalized_commandget_package_dirr)   r*   )	ri   r   packagerz   package_dir	file_namebase_class_2r   r<   s	         r   rh   z._add_py_module.<locals>.build_ext_make_mod.run   s    T"||)//4((;s#3455jA&66w?'Oe3	RWW\\+yAB r	   Nrk   )r   r   r<   s   r   rn   r      s	    		Cr	   rn   )setuptools.command.build_pyrz   rq   rS   r   rT   rU   rG   rC   rv   rw   r   ru   )r4   r;   r<   rz   rS   r   rn   rj   r   r   rT   rU   rC   s    ``    @@@@@@r   r2   r2      s    464+ + "":x8J3 3J 3" !2DMM* OO;' ==$$[)<L
C 
C\ 
C "4DMM+r	   c                 ^    |dk(  sJ t        |t              r|g}|D ]  }t        | |        y )Ncffi_modules)r#   r$   r@   )r4   attrvaluecffi_modules       r   r   r      s:    >!!!%$ +k*+r	   )r)   rH   r$   	NameErrorr&   r   r   r@   rP   r3   r2   r   ro   r	   r   <module>r      sR    	 

#

+NZB%4X:4x+Y  Js   " ,,