%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/idlelib/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/idlelib/__pycache__/runscript.cpython-38.pyc

U

qaQ @sdZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddl	mZddlm
Z
ddl	mZd	ZGd
ddZedkrdd
lmZeddddS)aExecute 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@sZeZdZddZddZddZddZd	d
Zddd
dZddZ	ddZ
ddZdS)
ScriptBindingcCs*||_|jj|_|jj|_g|_d|_dS)Ng)editwinflistrootcli_argsperf)selfr	r-/usr/local/lib/python3.8/idlelib/runscript.py__init__&s


zScriptBinding.__init__cCsNt|jtjr|jjdS|}|s.dS||s<dS||sJdSdS)Nbreak)	
isinstancer	rOutputWindowtextbellgetfilenamechecksyntaxtabnanny)reventfilenamerrrcheck_module_event0s

z ScriptBinding.check_module_eventcCst|}ztt|jWntjk
r}z>|j\}\}}|j	||
dd|WYW5QRdSd}~XYnPtjk
r}z0|j	||
dt
WYW5QRdSd}~XYnXW5QRXdS)NzTabnanny Tokenizing ErrorzToken Error: %sFzTab/space errorT)tokenizeopenrZprocess_tokensgenerate_tokensreadline
TokenErrorargsr	ZgotolineerrorboxZNannyNagZ
get_linenoindent_message)rrfmsgZmsgtxtlinenostartZnagrrrr=s ,zScriptBinding.tabnannyc

Csl|j|_}|}||jt|d}|}W5QRXd|krb|dd}|dd}|r~|dt	dkr~|d}|j
}|j}|dddzzt
||d	WWStttfk
rV}zt|d
dp|pd}	t|d
dpd}
t|ddpd}|dkr|
d7}
d|
d|df}||||dd|	WYWdSd}~XYnXW5||XdS)Nrb
s

ERRORz1.0endexecr&z<no detail available>r'offsetrz0.0 + %d lines + %d charsSyntaxErrorz%-20sF)r
Z
open_shellshellZget_warning_streamZset_warning_streamstderrrreadreplaceordr	rZ
tag_removecompiler3
OverflowError
ValueErrorgetattrZcolorize_syntax_errorr#)
rrr4Zsaved_streamr%sourcer	rvaluer&r'r2posrrrrOs4
 zScriptBinding.checksyntaxcCs|j|ddS)NT	customize)run_module_event)rrrrrrun_custom_eventmszScriptBinding.run_custom_eventFr@c	Cs.trt|jdkrdSt|jtjr<|jj	
dS|}|sLdS||}|s^dS|
|sldS|rd|jd}t|jj	||jdj}|sdS|r|ngdf\|_}|jj}tjr|r|jd|dtj|}	|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	isCocoaTktimeperf_counterr
rr	rrrrrrrZshort_titlerr4rresultinterprZuse_subprocessZrestart_subprocessospathdirnameZ
runcommandZprepend_syspathZruncode)rrrArcodetitleZrun_argsZrestartrGrJargvrrrrBpsF	






zScriptBinding.run_module_eventcCsx|jjj}|jsttjddddd}|r>|r>|jjdn6|}|jj	|rp|jjd|jjj}nd}|S)aGet 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.

        mainZGeneralautosavebool)typeN)
r	iorZ	get_savedrZ	GetOptionsaveask_save_dialogr	focus_set)rrrOconfirmrrrrs

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

9r__main__)rNz idlelib.idle_test.test_runscript)	verbosity)__doc__rHrrDrtkinterrZidlelib.configrZidlelibrrZ
idlelib.queryrrr$rrZZunittestrNrrrr<module>s 0

Zerion Mini Shell 1.0