ok

Mini Shell

Direktori : /opt/alt/python36/lib64/python3.6/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/__pycache__/runscript.cpython-36.opt-2.pyc

3

��2a��@s|ddlZddlZddlZddljZddlmZddlm	Z	ddlm
Z
dZGdd�d�Ze
dkrxdd	lmZed
dd�dS)
�N)�idleConf)�macosx)�pyshella/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@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�
ScriptBindingcCs8||_|jj|_|jj|_tj�r4|jjjd|j�dS)Nz<<run-module-event-2>>)�editwin�flist�rootr�	isCocoaTk�
text_frameZbind�_run_module_event)�selfr�r
�./opt/alt/python36/lib64/python3.6/runscript.py�__init__#s


zScriptBinding.__init__cCs0|j�}|sdS|j|�sdS|j|�s,dSdS)N�break)�getfilename�checksyntax�tabnanny)r�event�filenamer
r
r�check_module_event-s

z ScriptBinding.check_module_eventcCs�tj|���}ytjtj|j��Wn�tjk
rn}z.|j\}\}}|jj	|�|j
dd|�dSd}~Xn>tjk
r�}z |jj	|j��|j
dt
�dSd}~XnXWdQRXdS)NzTabnanny Tokenizing ErrorzToken Error: %sFzTab/space errorT)�tokenize�openrZprocess_tokens�generate_tokens�readline�
TokenError�argsrZgotoline�errorboxZNannyNagZ
get_lineno�indent_message)rr�f�msgZmsgtxt�lineno�startZnagr
r
rr7s
zScriptBinding.tabnannyc
CsZ|jj�|_}|j�}|j|j�t|d��}|j�}WdQRXd|krb|jdd�}|jdd�}|r~|dt	d�kr~|d}|j
}|j}|jddd�z�yt
||d	�Stttfk
�rD}zzt|d
d�p�|p�d}	t|d
d�p�d}
t|dd�p�d}|dk�r|
d7}
d|
d|df}|j||�|jdd|	�dSd}~XnXWd|j|�XdS)N�rb�
s
�
�ZERRORz1.0�end�execr �z<no detail available>r!�offsetrz0.0 + %d lines + %d chars�SyntaxErrorz%-20sF���)rZ
open_shell�shellZget_warning_streamZset_warning_stream�stderrr�read�replace�ordr�textZ
tag_remove�compiler+�
OverflowError�
ValueError�getattrZcolorize_syntax_errorr)
rrr-Zsaved_streamr�sourcerr2�valuer r!r*�posr
r
rrIs4
zScriptBinding.checksyntaxcs2tj�r$�jjjd�fdd��dS�j|�SdS)N��cs�jjjd�S)Nz<<run-module-event-2>>)rr
Zevent_generater
)rr
r�<lambda>osz0ScriptBinding.run_module_event.<locals>.<lambda>r)rr	rr
�afterr)rrr
)rr�run_module_eventgs

zScriptBinding.run_module_eventcCs�|j�}|sdS|j|�}|s"dS|j|�s0dS|jj}tjrT|jd|jj	|�d�t
jj|�}|j
dj||d��|j|�|j|�dS)NrF)Zwith_cwdrazif 1:
            __file__ = {filename!r}
            import sys as _sys
            from os.path import basename as _basename
            if (not _sys.argv or
                _basename(_sys.argv[0]) != _basename(__file__)):
                _sys.argv = [__file__]
            import os as _os
            _os.chdir({dirname!r})
            del _sys, _basename, _os
            
)r�dirname)rrrr-�interprZuse_subprocessZrestart_subprocessrZ_filename_to_unicode�os�pathr>Z
runcommand�formatZprepend_syspathZruncode)rrr�coder?r>r
r
rrts$	




zScriptBinding._run_module_eventcCsx|jjj}|jj�sttjddddd�}|r>|r>|jjjd�n6|j�}|jjj	�|rp|jjjd�|jjj}nd}|S)N�mainZGeneral�autosave�bool)�type)
r�iorZ	get_savedrZ	GetOptionZsave�ask_save_dialogr2�	focus_set)rrrE�confirmr
r
rr�s


zScriptBinding.getfilenamecCs d	}tjd|tj|jjd�}|S)
NzSource Must Be Saved
�� zOK to Save?zSave Before Run or Check)�title�message�default�parentz     zSource Must Be Saved
     z%Source Must Be Saved
     OK to Save?)�tkMessageBoxZaskokcancelZOKrr2)rr rKr
r
rrI�szScriptBinding.ask_save_dialogcCs$tj|||jjd�|jjj�dS)N)rQ)rRZ	showerrorrr2rJ)rrNrOr
r
rr�szScriptBinding.errorboxN)�__name__�
__module__�__qualname__rrrrr=rrrIrr
r
r
rr!s


)r�__main__)rDz idlelib.idle_test.test_runscript�)�	verbosity)r@rrZtkinter.messageboxZ
messageboxrRZidlelib.configrZidlelibrrrrrSZunittestrDr
r
r
r�<module>s

&

Zerion Mini Shell 1.0