%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.12/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.12/__pycache__/py_compile.cpython-312.pyc

�

���f�����dZddlZddlZddlZddlZddlZddlZddlZddl	Z	gd�Z
Gd�de�ZGd�dej�Zd�Z		dd	�Zd
�Zedk(re�yy)
zqRoutine to "compile" a .py file to a .pyc file.

This module has intimate knowledge of the format of .pyc files.
�N)�compile�main�PyCompileError�PycInvalidationModec��eZdZdZdd�Zd�Zy)ra�Exception raised when an error occurs while attempting to
    compile the file.

    To raise this exception, use

        raise PyCompileError(exc_type,exc_value,file[,msg])

    where

        exc_type:   exception type to be used in error message
                    type name can be accesses as class variable
                    'exc_type_name'

        exc_value:  exception value to be used in error message
                    can be accesses as class variable 'exc_value'

        file:       name of file being compiled to be used in error message
                    can be accesses as class variable 'file'

        msg:        string message to be written as error message
                    If no value is given, a default exception message will be
                    given, consistent with 'standard' py_compile output.
                    message (or default) can be accesses as class variable
                    'msg'

    c�,�|j}|tur;djtj||��}|jdd|z�}nd|�d|��}tj||xs||||�||_||_	||_
|xs||_y)N�zFile "<string>"z	File "%s"zSorry: z: )�__name__�SyntaxError�join�	traceback�format_exception_only�replace�	Exception�__init__�
exc_type_name�	exc_value�file�msg)�self�exc_typerrrr�tbtext�errmsgs        �!/usr/lib/python3.12/py_compile.pyrzPyCompileError.__init__.s��� �)�)�
��{�"��W�W�Y�<�<��)�%�&�F��^�^�$5�{�T�7I�J�F�#�
)6�i�@�F����4��
�v�m�I�d�K�*���"�����	��=�&���c��|jS)N)r)rs r�__str__zPyCompileError.__str__>s���x�x�rN)r	)r
�
__module__�__qualname__�__doc__rr�rrrrs���6!� rrc��eZdZdZdZdZy)r���N)r
rr�	TIMESTAMP�CHECKED_HASH�UNCHECKED_HASHr!rrrrBs���I��L��Nrrc��tjjd�rtjStj
S)N�SOURCE_DATE_EPOCH)�os�environ�getrr'r&r!rr�_get_default_invalidation_moder.Hs+��	�z�z�~�~�)�*�"�/�/�/�"�,�,�,rc��|�
t�}|�O|dk\r+|dk\r|nd}tjj||��}ntjj|�}tj
j
|�rd}t|j|���tj
j|�r;tj
j|�sd}t|j|���tjjd|�}	|	j|�}
	|	j|
|xs||�	�}	tj
j-|�}|rt	j.|�|t0j2k(r9|	j5|�}tj6j9||d|d
�}nQtjj;|
�}tj6j=|||t0j>k(�}tj6jA|�}tj6jC|||�|S#t$rZ}t!|j"||xs|�}
|d
kr0|r|
�t$j&j)|
j*dz�Yd}~yd}~wwxYw#t$rY��QwxYw)a�Byte-compile one Python source file to Python bytecode.

    :param file: The source file name.
    :param cfile: The target byte compiled file name.  When not given, this
        defaults to the PEP 3147/PEP 488 location.
    :param dfile: Purported file name, i.e. the file name that shows up in
        error messages.  Defaults to the source file name.
    :param doraise: Flag indicating whether or not an exception should be
        raised when a compile error is found.  If an exception occurs and this
        flag is set to False, a string indicating the nature of the exception
        will be printed, and the function will return to the caller. If an
        exception occurs and this flag is set to True, a PyCompileError
        exception will be raised.
    :param optimize: The optimization level for the compiler.  Valid values
        are -1, 0, 1 and 2.  A value of -1 means to use the optimization
        level of the current interpreter, as given by -O command line options.
    :param invalidation_mode:
    :param quiet: Return full output with False or 0, errors only with 1,
        and no output with 2.

    :return: Path to the resulting byte compiled file.

    Note that it isn't necessary to byte-compile Python modules for
    execution efficiency -- Python itself byte-compiles a module when
    it is loaded, and if it can, writes out the bytecode to the
    corresponding .pyc file.

    However, if a Python installation is shared between users, it is a
    good idea to byte-compile all modules upon installation, since
    other users may not be able to write in the source directories,
    and thus they won't be able to write the .pyc file, and then
    they would be byte-compiling every module each time it is loaded.
    This can slow down program start-up considerably.

    See compileall.py for a script/module that uses this module to
    byte-compile all installed files (or all files in selected
    directories).

    Do note that FileExistsError is raised if cfile ends up pointing at a
    non-regular file or symlink. Because the compilation uses a file renaming,
    the resulting file would be regular and thus not the same type of file as
    it was previously.
    Nrr#r	)�optimizationzc{} is a symlink and will be changed into a regular file if import writes a byte-compiled file to itzk{} is a non-regular file and will be changed into a regular one if import writes a byte-compiled file to itz<py_compile>)�	_optimizer$�
�mtime�size)"r.�	importlib�util�cache_from_sourcer+�path�islink�FileExistsError�format�exists�isfile�	machinery�SourceFileLoader�get_data�source_to_coderr�	__class__�sys�stderr�writer�dirname�makedirsrr&�
path_stats�_bootstrap_external�_code_to_timestamp_pyc�source_hash�_code_to_hash_pycr'�
_calc_mode�
_write_atomic)r�cfile�dfile�doraise�optimize�invalidation_mode�quietr0r�loader�source_bytes�code�err�py_excrF�source_stats�bytecoderK�modes                   rrrOs_��Z� �:�<���}��q�=�'/�1�}�8�"�L��N�N�4�4�T�BN�5�P�E��N�N�4�4�T�:�E�	�w�w�~�~�e��:���c�j�j��/�0�0�	������	�r�w�w�~�~�e�'<�A���c�j�j��/�0�0�
�
 �
 �
1�
1�.�$�
G�F��?�?�4�(�L�
��$�$�\�5�=�D�/7�%�9��
��'�'�/�/�%�(����K�K�� ��/�9�9�9��(�(��.���0�0�G�G��,�w�'��f�)=�?�� �n�n�0�0��>���0�0�B�B���
�"5�"B�"B�
B�
��
�(�(�3�3�D�9�D�
�!�!�/�/��x��F��L��7����
�
�s�E�M�T�B���1�9�����
�
� � ����d�!2�3������
��
�s+�%I�>6J9�	J6�AJ1�1J6�9	K�Kc���ddl}d}|j|��}|jdddd��|jd	d
d��|j�}|jd
gk(r;t
jj�D�cgc]}|jd���}}n|j}|D]!}|jd�}	t|d���#ycc}w#t$rD}|jr|jd�n|jd|j�Yd}~�rd}~wt$rC}|jr|jd�n|jdt|��Yd}~��d}~wwxYw)Nrz6A simple command-line interface for py_compile module.)�descriptionz-qz--quiet�
store_truezSuppress error output)�action�help�	filenames�+zFiles to compile)�nargsra�-r2T)rQr#)�argparse�ArgumentParser�add_argument�
parse_argsrbrC�stdin�	readlines�rstriprrrT�exitr�OSError�str)rfr^�parser�args�filenamerb�errors       rrr�s@���J�K�
�
$�
$��
$�
=�F�
����i��
$���
�����
���
����D��~�~�#���;>�9�9�;N�;N�;P�Q�x�X�_�_�T�*�Q�	�Q��N�N�	��
+���?�?�4�(��	+��H�d�+�
+��R���	*��z�z����A�����A�u�y�y�)����	+��z�z����A�����A�s�5�z�*���		+�s*�C�
C�	E,�:D�E,�)9E'�'E,�__main__)NNF���Nr)r �enum�importlib._bootstrap_externalr5�importlib.machinery�importlib.utilr+�os.pathrCr
�__all__rr�Enumrr.rrr
r!rr�<module>r}sv���
�$���	��
��
F��-�Y�-�`�$�)�)��-�CE�*+�^�B!+�H�z���F�r

Zerion Mini Shell 1.0