File "ScriptBinding.cpython-34.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python34/lib64/python3.4/idlelib/__pycache__/ScriptBinding.cpython-34.pyc
File size: 6.92 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


e f}@sdZddlZddlZddlZddljZddlmZddl	m
Z
ddlmZdZGdddZ
dS)	a?Extension to execute code outside the Python shell window.

This adds the following commands:

- Check module does a full syntax check of the current module.
  It also runs the tabnanny to catch any inconsistent tabs.

- Run module executes 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.

XXX GvR Redesign this interface (yet again) as follows:

- Present a dialog box for ``Run Module''

- Allow specify command line arguments in the dialog box

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@seZdZddddgfgZddZd	d
ZddZd
dZddZddZ	ddZ
ddZddZdS)
ScriptBindingZrunNCheck Module<<check-module>>
Run Module<<run-module>>cCsS||_|jj|_|jj|_tjrO|jjjd|jndS)Nz<<run-module-event-2>>)editwinflistrootr	isCocoaTk
text_frameZbind_run_module_event)selfr
r:/opt/alt/python34/lib64/python3.4/idlelib/ScriptBinding.py__init__/s
	zScriptBinding.__init__cCs@|j}|sdS|j|s)dS|j|s<dSdS)Nbreak)getfilenamechecksyntaxtabnanny)reventfilenamerrrcheck_module_event9sz ScriptBinding.check_module_eventcCstj|}ytjtj|jWntjk
r}zB|j\}\}}|jj	||j
dd|dSWYdd}~XnRtjk
r}z/|jj	|j|j
dt
dSWYdd}~XnXWdQXdS)NzTabnanny Tokenizing ErrorzToken Error: %sFzTab/space errorT)tokenizeopenrZprocess_tokensgenerate_tokensreadline
TokenErrorargsr
ZgotolineerrorboxZNannyNagZ
get_linenoindent_message)rrfmsgZmsgtxtlinenostartZnagrrrrBs	zScriptBinding.tabnannyc
Cs|jj|_}|j}|j|jt|d}|j}WdQXd|kr|jdd}|jdd}n|r|dt	dkr|d}n|j
}|j}|jdddzyt
||d	SWntttfk
r}zt|d
dp'|p'd}	t|d
dp?d}
t|ddpWd}|dkrs|
d7}
nd|
d|df}|j|||jdd|	dSWYdd}~XnXWd|j|XdS)Nrbs
s
s
ZERRORz1.0endexecr$z<no detail available>r%offsetrz0.0 + %d lines + %d charsSyntaxErrorz%-20sF)rZ
open_shellshellZget_warning_streamZset_warning_streamstderrrreadreplaceordr
textZ
tag_removecompiler-
OverflowError
ValueErrorgetattrZcolorize_syntax_errorr!)
rrr/Zsaved_streamr#sourcer
r4valuer$r%r,posrrrrTs4
		
zScriptBinding.checksyntaxcsCtjr2jjjdfdddSj|SdS)NcsjjjdS)Nz<<run-module-event-2>>)r
rZevent_generater)rrr<lambda>zsz0ScriptBinding.run_module_event.<locals>.<lambda>r)rr
r
rafterr)rrr)rrrun_module_eventrs
zScriptBinding.run_module_eventcCs|j}|sdS|j|}|s/dS|j|sBdS|jj}tjr||jddd|jj	|nt
jj|}|j
djd|d||j||j|dS)aXRun the module after setting up the environment.

        First check the syntax.  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.
        rZwith_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)rrrr/interprZuse_subprocessZrestart_subprocessr
Z_filename_to_unicodeospathr@Z
runcommandformatZprepend_syspathZruncode)rrrcoderAr@rrrrs$		


zScriptBinding._run_module_eventcCs|jjj}|jjstjddddd}|r[|r[|jjjdq|j}|jjj	|r|jjjd|jjj}qd}n|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.

        mainZGeneralautosavetypeboolN)
r
iorZ	get_savedrZ	GetOptionZsaveask_save_dialogr4	focus_set)rrrGconfirmrrrrs	zScriptBinding.getfilenamec	Cs?dd
d}tjddd|dtjd	|jj}|S)NzSource Must Be Saved
 zOK to Save?titlezSave Before Run or Checkmessagedefaultparentz     )tkMessageBoxZaskokcancelZOKr
r4)rr$rMrrrrKs	zScriptBinding.ask_save_dialogcCs0tj||d|jj|jjjdS)NrS)rTZ	showerrorr
r4rL)rrPrQrrrr!szScriptBinding.errorbox)rr)rr	)
__name__
__module____qualname__Zmenudefsrrrrr?rrrKr!rrrrr(s
	
)r)__doc__rBrrZtkinter.messageboxZ
messageboxrTZidlelibrZidlelib.configHandlerrrr"rrrrr<module>s