Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
verifier.cpython-313.pyc56 linesDownload Raw Back to __pycache__
1�

2��j�+��8�SSKrSSKrSSKrSSKrSSKrSSKJr SSKJr SSKJ	r	 \RS:�aSSKrSr
OSSKrSr
\RS	:�a
\RrO"S3S\R"5r"SS
\5rSrSrSqSrSrSSjrSrSrg)�N�)�__version_verifier_modules__)�ffiplatform)�VerificationError)�rc�<�[RRSS$�N)�	importlib�	machinery�EXTENSION_SUFFIXES���SD:\code\apps\devtools\python\user_packages\Python313\site-packages\cffi/verifier.py�_extension_suffixesrs���"�"�5�5�a�8�8rc��[R"5VVVs/sHupnU[R:XdMUPM  snnn$s snnnfr	)�imp�get_suffixes�C_EXTENSION)�suffix�_�types   rrrs@��.1�.>�.>�.@�,�.@�?�6�d��3�?�?�*��.@�,�	,��,s4�A�A�rc�(^�\rSrSrU4SjrSrU=r$)�NativeIO�c�x>�[U[5(aURS5n[[U]U5 g)N�ascii)�5isinstance�unicode�encode�superr�write)�self�s�	__class__s  �rr"�NativeIO.writes-����!�W�%�%��H�H�W�%���(�D�'��*rr
)�__name__�6__module__�__qualname__�__firstlineno__r"�__static_attributes__�
__classcell__)r%s@rrrs
���	+�	+rrc�t�\rSrSrSSjrSSjrSrSrSrSr	S	r7S8rSrSr
SS
jrSrSrSrg)�Verifier�Nc��URR(a#[SURR<35eXlX lU(d[9R"U5n[X5n
U
"U5UlURRU5 X�l10URX�5UlU(aU(a[S5eGOSRS[R SS-["UW/UR$-5n[R S:�aUR'S5n[)[*R,"USSS25S	-5nUR/S115R1S5n[)[*R,"USSS25S	-5nUR/S
5R1S5nSU<SURR2<U<U<3n[55SnU=(d12 [75Ul[:R<RUR8XH-5Ul[:R<RUR8UU-5Ul XPl!SUl"SUl#g)NzIfeature not supported with ffi.verify(), but only with ffi.set_source(): z)can't specify both 'modulename' and 'tag'�z%d.%d�rzutf-8rl���0x�Lr�0�_cffi_rF)$�_parser�_uses_new_featurer�ffi�preambler�flatten�_locate_engine_class�_vengine�patch_extension_kwds�flags�make_relative_to�kwds�	TypeError�join�sys�version_infor�_cdefsourcesr �hex�binascii�crc32�lstrip�rstrip�13_class_key�_get_so_suffixes�_caller_dir_pycache�tmpdir�os�path�sourcefilename�modulefilename�ext_package�_has_source�_has_module)r#r9r:rO�14modulenamerT�tag�force_generic_engine�source_extensionr?�relative_torA�flattened_kwds�
vengine_class�key�k1�k2rs                  r�__init__�Verifier.__init__ s���;�;�(�(�#�/2�{�{�/L�/L�O�P�
P��� �
��(�0�0��6�N�,�S�G�
�%�d�+��
��
�
�*�*�4�0��15��)�)�$�<��	���� K�L�L���+�+�w��)9�)9�"�1�)=�=�;�'��9�"�.�.�/�0�C����4�'��j�j��)���X�^�^�C���1��I�.��;�<�B����4��'�'��,�B��X�^�^�C���1��I�.��;�<�B����3��&�&�s�+�B�.1�4�=�=�3K�3K�.0�"�6�J�!�#�A�&���5� 3� 5��� �g�g�l�l�4�;�;�16�8U�V��� �g�g�l�l�4�;�;�17�V�8K�L���&�� ��� ��rc���URR UR(aUc[S5eUR	U5 SSS5 g!,(df   g=f)zcWrite the C source code.  It is produced in 'self.sourcefilename',18which can be tweaked beforehand.Nzsource code already written)r9�_lockrUr�
_write_source�r#�files  r�write_source�Verifier.write_sourceIsD���X�X�^�^����D�L�'�1�3�3����t�$�	�^�^�s�1A�19Ac���URR UR(a[S5eUR(dUR5 UR
5 SSS5 g!,(df   g=f)z|Write the C source code (if not done already) and compile it.20This produces a dynamic link library in 'self.modulefilename'.zmodule already compiledN)r9rdrVrrUre�_compile_module�r#s r�compile_module�Verifier.compile_moduleRsO���X�X�^�^����'�(A�B�B��#�#��"�"�$�� � �"��^�^�s�AA.�.21A<c�J�URR UR(dRUR5 UR(d1UR(dUR5 UR
5 UR5sSSS5 $!,(df   g=f)z�Get a C module from this Verifier instance.22Returns an instance of a FFILibrary class that behaves like the23objects returned by ffi.dlopen(), but that delegates all24operations to the C module.  If necessary, the C code is written25and compiled first.26N)r9rdrV�_locate_modulerUrerk�
_load_libraryrls r�load_library�Verifier.load_library\sd���X�X�^�^��#�#��#�#�%��'�'��+�+��*�*�,��(�(�*��%�%�'��^�^�s�A3B�27B"c���[RRUR5nUR	SS5SnURS5(a[
[S5(aUSSnU$)N�.rr�_d�gettotalrefcount�����)rPrQ�basenamerS�split�endswith�hasattrrD)r#rys  r�get_module_name�Verifier.get_module_namelsc���7�7�#�#�D�$7�$7�8���>�>�#�q�)�!�,�����T�"�"�w�s�4F�'G�'G����}�H��rc�h�UR(d@URR UR(dUR5 SSS5 [R28"UR5nUR5n[R"X40URD6$!,(df   N_=fr	)29rUr9rdrer�maybe_relative_pathrRr}�
get_extensionrA)r#�30sourcename�modnames   rr��Verifier.get_extensionwsx�����������'�'��&�&�(� �!�4�4�T�5H�5H�I�31��&�&�(���(�(��J��	�	�J�J� ��s�"B#�#32B1c�.�URR$r	)r=�_gen_python_modulerls r�generates_python_module� Verifier.generates_python_module�s���}�}�/�/�/rc���U(a�[RRU5(a�[RRU5nUR5n[R33HlnXA;dM34Xn[
U[[45(d[SU<S35eUVs/sH"n[RRX65PM$ nnXQU'Mn U$s snf)Nz	keyword 'z' should be a list or tuple)rPrQ�dirname�copyr�LIST_OF_FILE_NAMESr�list�tuplerBrC)r#rAr[r�r^�lst�fns       rr@�Verifier.make_relative_to�s����2�7�7�?�?�;�7�7��g�g�o�o�k�2�G��9�9�;�D�"�5�5���;��)�C�%�c�D�%�=�9�9�'�+.�)1�2�2�?B�C�s��2�7�7�<�<��4�s�C�C� #��I�6����Ds�()Cc��[RRUR5(dwUR(a'[URSSS/5nURnOSnURRUR5U[55nUcgX0lURR5 SUl
g![a gf=f)N�__doc__T)rPrQ�isfilerSrT�35__import__�ImportError�__path__r=�find_moduler}rM�
collect_typesrV)r#�pkgrQ�filenames    rrp�Verifier._locate_module�s����w�w�~�~�d�1�1�2�2�����$�T�%5�%5�t�T�I�;�O�C��|�|�����}�}�0�0��1E�1E�1G��1A�1C�E�H����"*���
�
�#�#�%�����#����s�C�36C�Cc��XRlURR5 UR?g!UR?f=fr	)r=�_f�write_source_to_frfs  r�_write_source_to�Verifier._write_source_to�s6���
�
��	!��M�M�+�+�-��
�
� ���
�
� �s	�9�Ac�6�UbURU5 g[5nURU5 UR5n[RRUR5(a4[URS5nUR5U:X+nSSS5 OSnW(aE[UR5 [URS5nURU5 SSS5 SUlg!,(df   Nb=f!,(df   N'=f)N�rT�w)r�r�getvaluerPrQ�existsrR�open�read�_ensure_dirr"rU)r#rg�f�source_data�fp�
needs_writtens      rre�Verifier._write_source�s������!�!�$�'��37�A��!�!�!�$��*�*�,�K��w�w�~�~�d�1�1�2�2��$�-�-�s�3�r�)+����k�$B�M�4�3�!%�
���D�/�/�0��$�-�-�s�3�r��H�H�[�)�4� $�D��4�3��4�3�s�C9�D38�939D�40 41Dc��[RRUR5n[R42"XR
55n[R"X R5nU(d5[UR5 [R"X R5 SUl
g![a SnNRf=f)NFT)rPrQr�rRr�compiler��samefilerS�OSErrorr��shutil�moverV)r#rO�outputfilename�sames    rrk�Verifier._compile_module�s���������!4�!4�5��$�,�,�V�5G�5G�5I�J��	��'�'��8K�8K�L�D����+�+�,��K�K��(;�(;�<������	��D�	�s� B3�3C�Cc���UR(deURb%URRUR5$URR5$r	)rVr?r=rrrls rrq�Verifier._load_library�sG��������:�:�!��=�=�-�-�d�j�j�9�9��=�=�-�-�/�/r)rVrUr=rTr9r?rArSr:rRrO)NNN�F�.cNNr	)r'r(r)r*rarhrmrrr}r�r�r@rpr�rerkrqr+r
rrr.r.sN��>B�@E�@D�'!�R%�#�(� 	�K�0��  �&!�$�2 �0rr.Fc���[(aSnU(d-S[R;aSnOSSKnUR43ULaSnU(aSSKJn UR$SSKJ	n UR$![a SnNJf=f)NT�__pypy__r�?r)�vengine_gen)�vengine_cpy)�_FORCE_GENERIC_ENGINErD�builtin_module_names�
_cffi_backendr��_backendr�r��VGenericEnginer��VCPythonEngine)r9rYr�r�r�s     rr<r<�sx����#�����1�1�1�#'� �
$�$��|�|�=�0�'+�$��!��)�)�)�!��)�)�)���
$� #�
�
$�s�A-�-A<�;A<c�|�[(a[$[RRS5nU(aU$[R44"S5RRn[RR[RR[RRU5S55$)N�CFFI_TMPDIRr2�__pycache__)�_TMPDIRrP�environ�getrD�	_getframe�f_code�co_filenamerQ�abspathrCr�)�resultr�s  rrNrN�sv���w���
�Z�Z�^�^�M�
*�F�
��
��}�}�Q��&�&�2�2�H�
�7�7�?�?�2�7�7�<�<�������(A�(�*�+�+rc��Uqg)z:Set the temporary directory to use instead of __pycache__.N)r�)r�s r�45set_tmpdirr�s	���Grc���U=(d46 [5n[R"U5nU(aSnO[	5SR5nUH�nUR5R
S5(dM)UR5RU5(d&UR5RS5(dMs[R"[RRX55 M� [RRUS5/nUH�n[R"U5Hon[RRXd5n[RRU5(aURU5 MY[R"U5 Mq M� g![a gf=f![a GM~f=f![a M�f=f)zyClean up the temporary directory by removing all files in it47called `_cffi_*.{c,so}` as well as the `build` subdirectory.Nr�rr6�build)
rNrP�listdirr�rM�lower�48startswithr{�unlinkrQrC�isdir�append)rO�keep_so�filelistrr��	clean_dir�dirs       r�cleanup_tmpdirr�sc���
,�*�,�F���:�:�f�%�����!�#�A�&�,�,�.����
�8�8�:� � ��*�*����49�#�#�F�+�+�r�x�x�z�/B�/B�4�/H�/H�
��	�	�"�'�'�,�,�v�2�3�	������f�g�.�/�I���	��j�j��o���W�W�\�\�#�*���7�7�=�=��$�$��$�$�R�(��I�I�b�M�&���������
��
���	��	�s6�F2�3G�$B	G�250F?�>F?�51G�G�52G"�!G"c�`�[5nU(d[RS:XaS/nU$S/nU$)N�win32z.pydz.so)rrD�platform)�suffixess rrMrM$s5��"�$�H���<�<�7�"��x�H��O��w�H��Orc���[RRU5nU(a<[RRU5(d[R"U5 gggr	)rPrQr�r��makedirs)r�r�s  rr�r�/s<���g�g�o�o�h�'�G��r�w�w�}�}�W�-�-�53���G��.�wr)NF)rDrPrHr��ior�rr�errorrrE�importlib.machineryr54rr�StringIOr�BytesIO�objectr.r�r<r�rNr�r�rMr�r
rr�<module>r�s���%�$�$�*��$����v���9��,�55���t���{�{�H�+�2�:�:�+�z0�v�z0�|��*�,��+��56�>	�r
codekingpro/portable-devtools · Team Ai