Your IP : 3.139.70.69


Current Path : /opt/alt/python35/lib64/python3.5/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/idlelib/__pycache__/ScriptBinding.cpython-35.opt-2.pyc



���]}�@s�ddlZddlZddlZddljZddlmZddlm	Z	ddlm
Z
dZGdd�d�ZdS)�N)�PyShell)�idleConf)�
macosxSupporta/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@s�eZdZddddgfgZdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�ZdS)�
ScriptBinding�runN�Check Module�<<check-module>>�
Run Module�<<run-module>>cCsP||_|jj|_|jj|_tj�rL|jjjd|j�dS)Nz<<run-module-event-2>>)�editwin�flist�rootr�	isCocoaTk�
text_frame�bind�_run_module_event)�selfr�r�2/opt/alt/python35/lib64/python3.5/ScriptBinding.py�__init__/s
	zScriptBinding.__init__cCs@|j�}|sdS|j|�s)dS|j|�s<dSdS)N�break)�getfilename�checksyntax�tabnanny)r�event�filenamerrr�check_module_event9sz ScriptBinding.check_module_eventcCs�tj|���}ytjtj|j��Wn�tjk
r�}zB|j\}\}}|jj	|�|j
dd|�dSWYdd}~XnRtjk
r�}z/|jj	|j��|j
dt
�dSWYdd}~XnXWdQRXdS)NzTabnanny Tokenizing ErrorzToken Error: %sFzTab/space errorT)�tokenize�openrZprocess_tokens�generate_tokens�readline�
TokenError�argsrZgotoline�errorboxZNannyNagZ
get_lineno�indent_message)rr�f�msgZmsgtxt�lineno�startZnagrrrrBs	zScriptBinding.tabnannyc
Cs�|jj�|_}|j�}|j|j�t|d��}|j�}WdQRXd|kr�|jdd�}|jdd�}|r�|dt	d�kr�|d}|j
}|j}|jddd�z�yt
||d	�SWn�tttfk
r�}z�t|d
d�p"|p"d}	t|d
d�p:d}
t|dd�pRd}|dkrk|
d7}
d|
d|df}|j||�|jdd|	�dSWYdd}~XnXWd|j|�XdS)N�rbs
s
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�textZ
tag_remove�compiler0�
OverflowError�
ValueError�getattrZcolorize_syntax_errorr#)
rrr2Zsaved_streamr%�sourcerr7�valuer&r'r/�posrrrrTs4
		
zScriptBinding.checksyntaxcsCtj�r2�jjjd�fdd��dS�j|�SdS)N��cs�jjjd�S)Nz<<run-module-event-2>>)rrZevent_generater)rrr�<lambda>zsz0ScriptBinding.run_module_event.<locals>.<lambda>r)rrrr�afterr)rrr)rr�run_module_eventrs
zScriptBinding.run_module_eventcCs�|j�}|sdS|j|�}|s/dS|j|�sBdS|jj}tjry|jddd|jj	|��t
jj|�}|j
djd|d|��|j|�|j|�dS)NrZwith_cwdFrazif 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
            
�dirname)rrrr2�interprZuse_subprocessZrestart_subprocessrZ_filename_to_unicode�os�pathrCZ
runcommand�formatZprepend_syspathZruncode)rrr�coderDrCrrrrs$		


zScriptBinding._run_module_eventcCs�|jjj}|jj�s�tjddddd�}|r[|r[|jjjd�nM|j�}|jjj	�|r�|jjjd�|jjj}nd}|S)N�mainZGeneral�autosave�type�bool)
r�iorZ	get_savedrZ	GetOption�save�ask_save_dialogr7�	focus_set)rrrJ�confirmrrrr�szScriptBinding.getfilenamec	Cs?dd
d}tjddd|dtjd	|jj�}|S)NzSource Must Be Saved
�� zOK to Save?�titlezSave Before Run or Check�message�default�parentz     )�tkMessageBoxZaskokcancelZOKrr7)rr&rQrrrrO�s	zScriptBinding.ask_save_dialogcCs0tj||d|jj�|jjj�dS)NrW)rXZ	showerrorrr7rP)rrTrUrrrr#�szScriptBinding.errorbox)rr)r	r
)
�__name__�
__module__�__qualname__ZmenudefsrrrrrBrrrOr#rrrrr(s
	
)r)
rErrZtkinter.messageboxZ
messageboxrXZidlelibrZidlelib.configHandlerrrr$rrrrr�<module>s


?>