Your IP : 216.73.216.60


Current Path : /opt/alt/python35/lib64/python3.5/site-packages/cffi/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/site-packages/cffi/__pycache__/setuptools_ext.cpython-35.pyc



.�W��@s�ddlZyeWnek
r.eZYnXdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�NcCs ddlm}||��dS)Nr)�DistutilsSetupError)�distutils.errorsr)�msgr�r�F/opt/alt/python35/lib64/python3.5/site-packages/cffi/setuptools_ext.py�error	srcCsRt|��}|j�}WdQRX|d7}t||d�}t|||�dS)N�
�exec)�open�read�compiler	)�filename�glob�f�src�coderrr�execfiles

rc
Csddlm}t|t�s9tdt|�jf�t|�}y|jd�\}}Wn#t	k
r�td|f�YnXt
jj|�s�d}|j
dd�d	}t
jj|�r�d
|d|f}td||f�dd
d|i}t||�y||}Wn&tk
rBtd||f�YnXt||�s[|�}t||�s�td|t|�jf�t|d�s�td|f�|j\}	}
}}|jr�|j�}|j|�|
dkr�t|||	�nt|||	|
||�dS)Nr)�FFIzEargument to 'cffi_modules=...' must be a str or a list of str, not %r�:z3%r must be of the form 'path/build.py:ffi_variable'��.�/z.pyz (rewrite cffi_modules to [%r])z#%r does not name an existing file%s�__name__Z__cffi__�__file__z!%r: object %r not found in modulez"%r is not an FFI instance (got %r)�_assigned_sourcez*%r: the set_source() method was not called)Zcffi.apir�
isinstance�
basestringr�typer�str�split�
ValueError�os�path�exists�replacer�KeyError�hasattrrZ_windows_unicode�copyZ_apply_windows_unicode�_add_py_module�
_add_c_module)
�distZmod_specrZbuild_file_nameZffi_var_name�extZ	rewrittenZmod_vars�ffi�module_name�source�source_extension�kwdsrrr�add_cffi_modulesL


				
r1cCsqd|krmddl}y6t|jjd�d�}|dkrMd|d<Wntk
rld|d<YnX|S)z�
    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.
    �py_limited_apirNr�T)�
setuptools�int�__version__�	partitionr )�	Extensionr0r4Zsetuptools_major_versionrrr�_set_py_limited_apiHs
r9c
	s3ddlm}ddlm}ddlm�ddlm�ddlm	�dg}|j
|jdg��t||�}|d	�d||��d��������	fd
d��|j
dkr�g|_
|j
j��|jjd|��G���fd
d�d��}	|	|jd<dS)Nr)r8)�	build_ext)�mkpath)�log)�
recompilerz$PLACEHOLDER�sources�namecs|tjj|���}�jd|��|�|dk	rM|����j���|�}|sx�jd�|S)Nzgenerating cffi module %rzalready up-to-date)r!r"�join�infoZ
make_c_source)Ztmpdir�pre_runZc_file�updated)r+r,r<r;r-r=r.r/rr�make_modhs


z_add_c_module.<locals>.make_modr:cs(eZdZ���fdd�ZdS)z)_add_c_module.<locals>.build_ext_make_modcsO�jddkr>t|dd�}�|j|��jd<�j|�dS)Nrz$PLACEHOLDERrB)r>�getattr�
build_temp�run)�selfrB)�
base_classr+rDrrrG}sz-_add_c_module.<locals>.build_ext_make_mod.runN)r�
__module__�__qualname__rGr)rIr+rDrr�build_ext_make_mod|srL)�distutils.corer8Zsetuptools.command.build_extr:�distutils.dir_utilr;�	distutilsr<�cffir=�extend�popr9�ext_modules�append�cmdclass�get)
r*r,r-r.r/r0r8r:Z
allsourcesrLr)
rIr+r,r<rDr;r-r=r.r/rr)[s 	*	"r)cs�ddlm�ddlm}ddlm}ddlm�ddlm	������fdd��|j
jd	|��G���fd
d�d��}||j
d	<|j
jd|��G���fd
d�d��}||j
d<dS)Nr)r;)�build_py)r:)r<)r=csS�jd|��tjj|���j��|�}|sO�jd�dS)Nzgenerating cffi module %rzalready up-to-date)rAr!r"�dirnameZmake_py_source)�py_filerC)r,r<r;r-r=rr�generate_mod�s
z$_add_py_module.<locals>.generate_modrWcs(eZdZ���fdd�ZdS)z)_add_py_module.<locals>.build_py_make_modcsJ�j|��jd�}|dd7<�tjj|j|��dS)Nr�z.py���)rGrr!r"r@�	build_lib)rH�module_path)rIrZr-rrrG�s
z-_add_py_module.<locals>.build_py_make_mod.runN)rrJrKrGr)rIrZr-rr�build_py_make_mod�sr_r:cs(eZdZ���fdd�ZdS)z*_add_py_module.<locals>.build_ext_make_modcs��j|�|jr��jd�}dj|dd��}|jd�}|j|�}|dd}�tjj||��dS)Nrr[rWz.pyr\r\)rGZinplacerr@�get_finalized_commandZget_package_dirr!r")rHr^�packagerW�package_dir�	file_name)�base_class_2rZr-rrrG�s
	z._add_py_module.<locals>.build_ext_make_mod.runN)rrJrKrGr)rdrZr-rrrL�srL)rNr;Zdistutils.command.build_pyrWZdistutils.command.build_extr:rOr<rPr=rUrV)r*r,r-rWr:r_rLr)rIrdr,rZr<r;r-r=rr(�s"
"r(cCsL|dkst�t|t�r*|g}x|D]}t||�q1WdS)N�cffi_modules)�AssertionErrorrrr1)r*�attr�valueZcffi_modulerrrre�s
	
re)r!r�	NameErrorrrrr1r9r)r(rerrrr�<module>s

-.&