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: 3.142.173.81
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : runscript.cpython-310.pyc
o

_bQ �@s�dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddl	mZddlm
Z
ddl	mZd	ZGd
d�d�ZedkrQdd
lmZeddd�dSdS)a�Execute code from an editor.

Check module: do a full syntax check of the current module.
Also run the tabnanny to catch any inconsistent tabs.

Run module: also execute the module's code in the __main__ namespace.
The window must have been saved previously. The module is added to
sys.modules, and is also added to the __main__ namespace.

TODO: Specify command line arguments in a dialog box.
�N)�
messagebox)�idleConf)�macosx)�pyshell)�	CustomRun)�outwina/Error: Inconsistent indentation detected!

1) Your indentation is outright incorrect (easy to fix), OR

2) Your indentation mixes tabs and spaces.

To fix case 2, change all tabs to spaces by using Edit->Select All followed by Format->Untabify Region and specify the number of columns used by each tab.
c@sZeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�d
d�Zdd�Z	dd�Z
dd�ZdS)�
ScriptBindingcCs*||_|jj|_|jj|_g|_d|_dS)Ng)�editwin�flist�root�cli_args�perf)�selfr	�r�:/usr/local/python-3.10/lib/python3.10/idlelib/runscript.py�__init__&s



zScriptBinding.__init__cCsNt|jtj�r|jj��dS|��}|sdS|�|�sdS|�|�s%dSdS)N�break)	�
isinstancer	r�OutputWindow�text�bell�getfilename�checksyntax�tabnanny)r�event�filenamerrr�check_module_event0s

z ScriptBinding.check_module_eventcCs�t�|��k}zt�t�|j��WnVtjy@}z"|j\}\}}|j�	|�|�
dd|�WYd}~Wd�dSd}~wtjyg}z|j�	|���|�
dt
�WYd}~Wd�dSd}~wwWd�dS1sswYdS)NzTabnanny Tokenizing ErrorzToken Error: %sFzTab/space errorT)�tokenize�openrZprocess_tokens�generate_tokens�readline�
TokenError�argsr	Zgotoline�errorboxZNannyNagZ
get_lineno�indent_message)rr�f�msgZmsgtxt�lineno�startZnagrrrr=s0�
��	
��	�
��zScriptBinding.tabnannyc

Cs�|j��|_}|��}|�|j�t|d��}|��}Wd�n1s&wYd|vr;|�dd�}|�dd�}|rI|dt	d�krI|d}|j
}|j}|�ddd�zdz
t
||d	�WW|�|�Stttfy�}zGt|d
d�px|pxd}	t|d
d�p�d}
t|dd�p�d}|dkr�|
d7}
d|
d|df}|�||�|�dd|	�WYd}~W|�|�dSd}~ww|�|�w)N�rb�
s
�
����ERRORz1.0�end�execr&�z<no detail available>r'��offsetrz0.0 + %d lines + %d chars�SyntaxErrorz%-20sF)r
Z
open_shell�shellZget_warning_streamZset_warning_stream�stderrr�read�replace�ordr	rZ
tag_remove�compiler3�
OverflowError�
ValueError�getattrZcolorize_syntax_errorr#)
rrr4Zsaved_streamr%�sourcer	r�valuer&r'r2�posrrrrOs>
����zScriptBinding.checksyntaxcCs|j|dd�S)NT��	customize)�run_module_event)rrrrr�run_custom_eventmszScriptBinding.run_custom_eventFr@c	Cs.t��rt��|jdkrdSt|jtj�r|jj	�
�dS|��}|s&dS|�|�}|s/dS|�
|�s6dS|rPd|j���d�}t|jj	||jd�j}|sPdS|rT|ngdf\|_}|jj}tjrk|rk|jd|d�tj�|�}	|g}
|jr||
|j7}
|�d	|�d
|
�d|	�d��|�|�|�|�dS)
ayRun the module after setting up the environment.

        First check the syntax.  Next get customization.  If OK, make
        sure the shell is active and then transfer the arguments, set
        the run environment's working directory to the directory of the
        module being executed and also add that directory to its
        sys.path if not already included.
        g�������?rz
Customize z Run)rTF)Zwith_cwdrzif 1:
            __file__ = zi
            import sys as _sys
            from os.path import basename as _basename
            argv = z�
            if (not _sys.argv or
                _basename(_sys.argv[0]) != _basename(__file__) or
                len(argv) > 1):
                _sys.argv = argv
            import os as _os
            _os.chdir(z:)
            del _sys, argv, _basename, _os
            
)rZ	isCocoaTk�time�perf_counterr
rr	rrrrrrrZshort_titlerr4r�result�interprZuse_subprocessZrestart_subprocess�os�path�dirnameZ
runcommandZprepend_syspathZruncode)rrrAr�code�titleZrun_argsZrestartrGrJ�argvrrrrBpsT	


��
�
��

�

zScriptBinding.run_module_eventcCs||jjj}|j��s<tjddddd�}|r |r |jj�d�|S|��}|jj�	�|r:|jj�d�|jjj}|Sd}|S)a�Get source filename.  If not saved, offer to save (or create) file

        The debugger requires a source file.  Make sure there is one, and that
        the current version of the source buffer has been saved.  If the user
        declines to save or cancels the Save As dialog, return None.

        If the user has configured IDLE for Autosave, the file will be
        silently saved if it already exists and is dirty.

        �mainZGeneral�autosave�bool)�typeN)
r	�iorZ	get_savedrZ	GetOption�save�ask_save_dialogr�	focus_set)rrrO�confirmrrrr�s 

�	�
�zScriptBinding.getfilenamecCs d}tjd|tj|jjd�}|S)Nz%Source Must Be Saved
     OK to Save?zSave Before Run or Check)rL�message�default�parent)rZaskokcancelZOKr	r)rr&rVrrrrT�s�zScriptBinding.ask_save_dialogcCs.tj|||jjd�|jj��t��|_dS)N)rY)rZ	showerrorr	rrUrDrEr
)rrLrWrrrr#�szScriptBinding.errorboxN)�__name__�
__module__�__qualname__rrrrrCrBrrTr#rrrrr$s

9r�__main__)rNz idlelib.idle_test.test_runscript�)�	verbosity)�__doc__rHrrDr�tkinterrZidlelib.configrZidlelibrrZ
idlelib.queryrrr$rrZZunittestrNrrrr�<module>s$0�
© 2025 GrazzMean