%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/python3.9/site-packages/numpy/distutils/__pycache__/
Upload File :
Create Path :
Current File : //lib64/python3.9/site-packages/numpy/distutils/__pycache__/lib2def.cpython-39.pyc

a

z[yc<�@sddlZddlZddlZdZdZdeejdd��ZddgZdeZ	e�
d	eej�Ze�
d
eej�Z
dd�Zddd
egdfdd�Zdd�Zejfdd�Zedk�re�\ZZedur�ejZn
eed�Zeee�gZeedd�Zee�\ZZeeee	e�dS)�Na�This module generates a DEF file from the symbols in
an MSVC-compiled DLL import library.  It correctly discriminates between
data and functions.  The data is collected from the output of the program
nm(1).

Usage:
    python lib2def.py [libname.lib] [output.def]
or
    python lib2def.py [libname.lib] > output.def

libname.lib defaults to python<py_ver>.lib and output.def defaults to stdout

Author: Robert Kern <kernr@mail.ncifcrf.gov>
Last Update: April 30, 1999
z0.1az%d%d�Znmz-CszrLIBRARY         python%s.dll
;CODE           PRELOAD MOVEABLE DISCARDABLE
;DATA           PRELOAD SINGLE

EXPORTS
z^(.*) in python%s\.dllz^_imp__(.*) in python%s\.dllcCsttj�dkr�tjddd�dkrNtjddd�dkrNtjdd�\}}nPtjddd�dkr�tjddd�dkr�tjdd�\}}ntd�td	�njttj�dkr�tjddd�dkr�tjd}d
t}n$tjddd�dkr�d}tjd}nd
t}d}||fS)zBParses the command-line arguments.

libfile, deffile = parse_cmd()�����Nz.librz.defz4I'm assuming that your first argument is the libraryzand the second is the DEF file.�python%s.lib)�len�sys�argv�print�py_ver)�libfile�deffile�r�=/usr/lib64/python3.9/site-packages/numpy/distutils/lib2def.py�	parse_cmd&s",,


rrTcCsHtj||tjtjdd�}|��\}}|jdkrDtdd�|�|f��|S)zUReturns the output of nm_cmd via a pipe.

nm_output = getnm(nm_cmd = 'nm -Cs py_lib')T)�shell�stdout�stderrZuniversal_newlinesrzfailed to run "%s": "%s"� )�
subprocess�Popen�PIPEZcommunicate�
returncode�RuntimeError�join)�nm_cmdr�p�	nm_outputZnm_errrrr�getnm>s�

�rcCs�t�|�}t�|�}g}|D]F}||vr|dd�dksX|dd�dksX|dd�dkr|�|�qg}|D]6}||vrl|dd�dks�|dd�dkrl|�|�ql|��|��||fS)z�Returns a tuple of lists: dlist for the list of data
symbols and flist for the list of function symbols.

dlist, flist = parse_nm(nm_output)NrZPyrZ_Py��init)�DATA_RE�findall�FUNC_RE�append�sort)r�data�func�flistZsym�dlistrrr�parse_nmJs

8(r*cCsB|D]}|d|}q|d}|D]}|d|}q"|�|�dS)zoOutputs the final DEF file to a file defaulting to stdout.

output_def(dlist, flist, header, file = sys.stdout)z		%s DATA
�
z	%s
N)�write)r)r(�header�fileZdata_symZfunc_symrrr�
output_def`sr/�__main__�wF)r)�rerr�__doc__�__version__�tuple�version_inforZ
DEFAULT_NMZ
DEF_HEADER�compile�	MULTILINEr#r!rrr*rr/�__name__rr
�open�strrrr)r(rrrr�<module>s0�




Zerion Mini Shell 1.0