Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.224.139.33
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : outwin.cpython-310.pyc
o

_bM�@s�dZddlZddlmZddlmZgd�Zdadd�Zdd	�Z	Gd
d�de�Z
Gdd
�d
�ZedkrBddl
mZedddd�dSdS)z0Editor window that can serve as an output file.
�N)�
messagebox)�EditorWindow)zfile "([^"]*)", line (\d+)z([^\s]+)\((\d+)\)z^(\s*\S.*?):\s*(\d+):z([^\s]+):\s*(\d+):z^\s*(\S.*?):\s*(\d+):cCsdd�tD�adS)z?Compile the patterns for matching to file name and line number.cSsg|]	}t�|tj��qS�)�re�compile�
IGNORECASE)�.0�patrr�7/usr/local/python-3.10/lib/python3.10/idlelib/outwin.py�
<listcomp>s�z!compile_progs.<locals>.<listcomp>N)�file_line_pats�file_line_progsrrrr
�
compile_progss
�rc	Cs�tst�tD]'}|�|�}|r.|�dd�\}}zt|d�}|��Wq1ty-YqwqdSz|t|�fWStyBYdSw)a-Extract file name and line number from line of text.

    Check if line of text contains one of the file/line patterns.
    If it does and if the file and line are valid, return
    a tuple of the file name and line number.  If it doesn't match
    or if the file or line is invalid, return None.
    ���rN)	r
r�search�group�open�close�OSError�int�	TypeError)�line�prog�match�filename�lineno�frrr
�file_line_helpers(

��	�rc@sheZdZdZgd�ZdZdd�Zdd�Zdd	�Zd
d�Z	ddd�Z
dd�Zdd�Zdd�Z
ddd�ZdS)�OutputWindowz�An editor window that can serve as an output file.

    Also the future base class for the Python shell window.
    This class has no input facilities.

    Adds binding to open a file at a line to the text widget.
    ))ZCutz<<cut>>Zrmenu_check_cut)ZCopyz<<copy>>Zrmenu_check_copy)ZPastez	<<paste>>Zrmenu_check_paste)NNN)zGo to file/line�<<goto-file-line>>NFcGs&tj|g|�R�|j�d|j�dS)Nr!)r�__init__�text�bind�goto_file_line)�self�argsrrr
r"NszOutputWindow.__init__cC�dS)z6Python source is only part of output: do not colorize.Fr)r&rrrr
�ispythonsourceS�zOutputWindow.ispythonsourcecCr()zCustomize EditorWindow title.ZOutputr�r&rrr
�short_titleWr*zOutputWindow.short_titlecCs|��rdSdS)z;Customize EditorWindow to not display save file messagebox.Zyes�no)Z	get_savedr+rrr
�	maybesave[szOutputWindow.maybesaver�insertcCs<t|t�sJ�|j�|||�|j�|�|j��t|�S)a�Write text to text widget.

        The text is inserted at the given index with the provided
        tags.  The text widget is then scrolled to make it visible
        and updated to display it, giving the effect of seeing each
        line as it is added.

        Args:
            s: Text to insert into text widget.
            tags: Tuple of tag strings to apply on the insert.
            mark: Index for the insert.

        Return:
            Length of text inserted.
        )�
isinstance�strr#r/Zsee�update�len�r&�s�tagsZmarkrrr
�write`s

zOutputWindow.writecCs|D]}|�|�qdS)z"Write each item in lines iterable.N)r7)r&�linesrrrr
�
writelinesvs�zOutputWindow.writelinescCr()z8No flushing needed as write() directly writes to widget.Nrr+rrr
�flush{r*zOutputWindow.flushcOstj|i|��dS�N)r�	showerror)r&r'�kwargsrrr
r<szOutputWindow.showerrorNcCsd|j�dd�}t|�}|s%|j�dd�}t|�}|s%|jdd|jd�dS|\}}|j�||�dS)	aHandle request to open file/line.

        If the selected or previous line in the output window
        contains a file name and line number, then open that file
        name in a new window and position on the line number.

        Otherwise, display an error messagebox.
        zinsert linestartzinsert lineendzinsert -1line linestartzinsert -1line lineendzNo special linezTThe line you point at doesn't look like a valid file name followed by a line number.)�parentN)r#�getrr<�flistZgotofileline)r&�eventr�resultrrrrr
r%�s 	��zOutputWindow.goto_file_line)rr/r;)�__name__�
__module__�__qualname__�__doc__Zrmenu_specsZallow_code_contextr"r)r,r.r7r9r:r<r%rrrr
r :s	
r c@s6eZdZddiddid�Zdd�Zdd�Zd	d
�ZdS)�OnDemandOutputWindowZ
foregroundZbluez#007700)�stdout�stderrcCs||_d|_dSr;)r@�owin)r&r@rrr
r"�s
zOnDemandOutputWindow.__init__cCs"|js|��|j�|||�dSr;)rJ�setupr7r4rrr
r7�szOnDemandOutputWindow.writecCsXt|j�|_}|j}|j��D]\}}|r|j|fi|��q|�d�|jj|_dS)NZsel)	r r@rJr#�tagdefs�itemsZ
tag_configureZ	tag_raiser7)r&rJr#�tagZcnfrrr
rK�s�
zOnDemandOutputWindow.setupN)rCrDrErLr"r7rKrrrr
rG�s�rG�__main__)�mainzidlelib.idle_test.test_outwinrF)�	verbosity�exit)rFr�tkinterrZidlelib.editorrrr
rrr rGrCZunittestrPrrrr
�<module>s	e�
© 2025 GrazzMean