OwlCyberSecurity - MANAGER
Edit File: pyshell.cpython-36.opt-2.pyc
3 ��2au�������������������@���s���d�dl�Z�yd�dlT�W�n*�ek r>���ede�jd��ed��Y�nX�e�jdkr�y d�dlZdZej d�j e��W�n�eeefk r����Y�nX�d�dl jZedk�r�e��atj���d�d lmZ�et��ejd de�td��ed��d�d lmZ�d�dlZd�dlZd�dlZd�dlmZ�d�dlZd�dlZd�dlZd�dl m!Z!�d�dl"Z"d�dl#Z#d�dl$Z$d�dl%Z%d�dl&m'Z'�d�dl(m)Z)�d�dl*m+Z+�d�dl*m,Z,�d�dl-m.Z.m/Z/�d�dl0m1Z1�d�dl2m3Z3�d�dl*m4Z4�d�dlm5Z5m6Z6m7Z7�d�dl8m9Z9�dZ:d�Z;e�ja<d8dd�Z=da>dd��Z?e?d��dej@fd d!�ZAeAe_@G�d"d#��d#e.�ZBG�d$d%��d%e1�ZCG�d&d'��d'e'�ZDG�d(d)��d)e9�ZEG�d*d+��d+e4jF�ZGG�d,d-��d-e�ZHG�d.d/��d/e3�ZId0d1��ZJd2ZKd3d4��ZLeMd5k�r�e�jNd5�e�jNd6<�eL���e?d7��dS�)9�����N)�*zJ** IDLE can't import Tkinter. Your Python may not be configured for Tk. **)�file�����win32Zshcoreg������!@)�fix_scalingzIdle Cannot Startz"Idle requires tcl/tk 8.5+, not %s.)�parent)�InteractiveInterpreter)�python_version)�TextWrapper)�ColorDelegator)�idleConf)�debugger)� debugger_r)�EditorWindow� fixwordbreaks)�FileList)�OutputWindow)�rpc)�idle_formatwarning�PseudoInputFile�PseudoOutputFile)� UndoDelegatorz 127.0.0.1c�������������C���sP���|d�krt�}y&|jt|�||||d���|jd��W�n�ttfk rJ���Y�nX�d�S�)N)�linez>>> )�warning_stream�writer����AttributeError�OSError)�message�category�filename�linenor���r�����r!����,/opt/alt/python36/lib64/python3.6/pyshell.py�idle_showwarningC���s����r#���c�������������C���s0���|�rt�d�kr,tja�tt_nt�d�k r,t�t_d�a�d�S�)N)�_warnings_showwarning�warnings�showwarningr#���)Zcapturer!���r!���r"����capture_warningsV���s����r'���Tc�������������C���s\���t�j}i�}x:t|�D�].}|d�d��|dd����dkr|j|�||<�qW�||���|j|��d�S�)Nr���z<>���)� linecache�cache�list�pop�update)r���Zorig_checkcacher*����save�keyr!���r!���r"����extended_linecache_checkcachee���s����r0���c���������������@���sz���e�Zd�Zdd��Zd&d'd(d)d*d+gZd,dd�Zdd��Zd-dd�Zd.dd�Zdd��Z dd��Z dd��Zd d!��Zd"d#��Z d$d%��ZdS�)/�PyShellEditorWindowc�������������G���s����g�|�_�tj|�f|����|�jjd|�j��|�jjd|�j��|�jjd|�jj��t j jtj d�|�_|�jj|�fdd�}|�jj|��|�jjr�|�j���|�j���d�S�)Nz<<set-breakpoint-here>>z<<clear-breakpoint-here>>z<<open-python-shell>>zbreakpoints.lstc�������������S���s���|j����|����d�S�)N)�restore_file_breaks)Zold_hook�selfr!���r!���r"����filename_changed_hook����s����z;PyShellEditorWindow.__init__.<locals>.filename_changed_hook)�breakpointsr����__init__�text�bind�set_breakpoint_here�clear_breakpoint_here�flist� open_shell�os�path�joinr���Zuserdir�breakpointPath�ioZfilename_change_hookZset_filename_change_hookr���r2����color_breakpoint_text)r3����argsr4���r!���r!���r"���r6������s����zPyShellEditorWindow.__init__�Cut�<<cut>>�rmenu_check_cut�Copy�<<copy>>�rmenu_check_copy�Paste� <<paste>>�rmenu_check_pasteN�Set Breakpoint�<<set-breakpoint-here>>�Clear Breakpoint�<<clear-breakpoint-here>>Tc�������������C���sD���|�j�d�krd�S�|r(tj��}tj|d�}n ddd�}|�jjd|��d�S�)N�break��)� foreground� background�BREAK)rA���r����CurrentTheme�GetHighlightr7���Z tag_config)r3���Zcolor�themeZcfgr!���r!���r"���rB�������s���� z)PyShellEditorWindow.color_breakpoint_textc�������������C���s����|�j�}|�jj}|jdd|�d|d����y|�jj|��W�n �tk rX���|�jj|��Y�nX�y|�jj j j}|j||��W�n���Y�nX�d�S�)NrU���z%d.0r���) r7���rA���r����tag_addr5����index� ValueError�appendr;����pyshell�interpr ���r9���)r3���r ���r7���r����debugr!���r!���r"����set_breakpoint����s����z"PyShellEditorWindow.set_breakpointc�������������C���s>���|�j�}|�jj}|s|j���d�S�tt|jd���}|�j|��d�S�)N�insert)r7���rA���r����bell�int�floatrZ���r`���)r3����eventr7���r���r ���r!���r!���r"���r9�������s����z'PyShellEditorWindow.set_breakpoint_herec�������������C���s����|�j�}|�jj}|s|j���d�S�tt|jd���}y|�jj|��W�n���Y�nX�|j ddd��y|�j jjj }|j||��W�n���Y�nX�d�S�)Nra���rU���zinsert linestartzinsert lineend +1char)r7���rA���r���rb���rc���rd���rZ���r5����remove� tag_remover;���r]���r^���r ���r:���)r3���re���r7���r���r ���r_���r!���r!���r"���r:�������s"����z)PyShellEditorWindow.clear_breakpoint_herec���������� ���C���sd���|�j�r`|�j}|�jj}|s$|j���d�S�g�|�_�|jddt��y|�jjj j }|j|��W�n���Y�nX�d�S�)NrU���z1.0)r5���r7���rA���r���rb���rg���ZENDr;���r]���r^���r ����clear_file_breaks)r3���r7���r���r_���r!���r!���r"���rh�������s����z%PyShellEditorWindow.clear_file_breaksc�������������C���s��|�j�}|�jj}y$t|�jd��}|j��}W�d�Q�R�X�W�n�tk rJ���g�}Y�nX�ynt|�jd��X}x$|D�]}|j|d��sb|j|��qbW�|�j ���|�j�}|r�|j|d�t |��d���W�d�Q�R�X�W�nV�tk �r�}�z8t|�jdd��s�d|�j_ tjdd t |��|�jd ��W�Y�d�d�}~X�nX�d�S�)N�r�w�=� �breakpoint_error_displayedFTz IDLE Errorz$Unable to update breakpoint list: %s)�titler���r���)r5���rA���r����openr@���� readlinesr���� startswithr����update_breakpoints�str�getattr�rootrm����tkMessageBox� showerrorr7���)r3���Zbreaksr����fp�linesZnew_filer����errr!���r!���r"����store_file_breaks����s.���� (z%PyShellEditorWindow.store_file_breaksc�������������C���s����|�j�j���|�jd�krd�S�|�jj}|d�kr,d�S�tjj|�j�r�t|�jd��}|j ��}W�d�Q�R�X�xJ|D�]B}|j |d��r`t|t|�d�d����}x|D�]}|�j |��q�W�q`W�d�S�)Nri���rk���r���)r7���r-���rA���r���r=���r>����isfiler@���ro���rp���rq����eval�lenr`���)r3���r���rx���ry���r���Zbreakpoint_linenumbersZbreakpoint_linenumberr!���r!���r"���r2��� ��s���� z'PyShellEditorWindow.restore_file_breaksc�������������C���s$���|�j�}|jd�}|�j|�}||�_d�S�)NrU���)r7���Z tag_ranges�ranges_to_linenumbersr5���)r3���r7����rangesZlinenumber_listr!���r!���r"���rr�����s���� z&PyShellEditorWindow.update_breakpointsc�������������C���sj���g�}x`t�dt|�d�D�]L}tt||�j��}tt||d��j��}x||k�r`|j|��|d7�}qDW�qW�|S�)Nr�������r���)�ranger~���rc���rd����stringr\���)r3���r����ry���rZ���r ����endr!���r!���r"���r���"��s���� z)PyShellEditorWindow.ranges_to_linenumbersc�������������C���s���|�j����tj|���d�S�)N)rh���r����_close)r3���r!���r!���r"���r����3��s����zPyShellEditorWindow._close)rD���rE���rF���)rG���rH���rI���)rJ���rK���rL���)NNN)rM���rN���N)rO���rP���N)T)N)N)�__name__� __module__�__qualname__r6����rmenu_specsrB���r`���r9���r:���rh���r{���r2���rr���r���r����r!���r!���r!���r"���r1���|���s"��� *r1���c���������������@���s���e�Zd�ZeZdZddd�ZdS�)�PyShellFileListNc�������������C���s8���|�j�r|�j�jj���nt|��|�_�|�j�r2|�j�j��s2d�S�|�j�S�)N)r]����top�wakeup�PyShell�begin)r3���re���r!���r!���r"���r<���B��s���� zPyShellFileList.open_shell)N)r����r����r����r1���r���r]���r<���r!���r!���r!���r"���r����9��s���r����c���������������@���s,���e�Zd�Zdd��Zdd��Zdd��Zdd��Zd S�) �ModifiedColorDelegatorc�������������C���s���t�j|���|�j���d�S�)N)r���r6����LoadTagDefs)r3���r!���r!���r"���r6���P��s���� zModifiedColorDelegator.__init__c�������������C���s*���|�j�ddd��|�jddd��tj|���d�S�)NZTODOz1.0�iomarkZSYNC)rg���rY���r����recolorize_main)r3���r!���r!���r"���r����T��s����z&ModifiedColorDelegator.recolorize_mainc�������������C���sJ���t�j|���tj��}|�jjd�d�d�tj|d�tj|d�tj|d�d���d�S�)N)rT���rS����stdout�stderr�console)�stdinr����r����r����)r���r����r���rV����tagdefsr-���rW���)r3���rX���r!���r!���r"���r����Y��s���� z"ModifiedColorDelegator.LoadTagDefsc�������������C���s"���x|�j�D�]}|�j|dd��qW�d�S�)Nr����r����)r����rg���)r3����tagr!���r!���r"����removecolorsc��s����z#ModifiedColorDelegator.removecolorsN)r����r����r����r6���r����r����r����r!���r!���r!���r"���r����M��s��� r����c���������������@���s ���e�Zd�Zddd�Zddd�ZdS�)�ModifiedUndoDelegatorNc���������� ���C���sL���y"|�j�j|dd�r |�j�j���d�S�W�n�tk r6���Y�nX�tj|�|||��d�S�)N�<r����)�delegate�comparerb����TclErrorr���ra���)r3���rZ����chars�tagsr!���r!���r"���ra���k��s���� zModifiedUndoDelegator.insertc�������������C���sJ���y"|�j�j|dd�r |�j�j���d�S�W�n�tk r6���Y�nX�tj|�||��d�S�)Nr����r����)r����r����rb���r����r����delete)r3���Zindex1Zindex2r!���r!���r"���r����t��s���� zModifiedUndoDelegator.delete)N)N)r����r����r����ra���r����r!���r!���r!���r"���r����h��s��� r����c���������������@���s���e�Zd�Zdd��ZdS�)�MyRPCClientc�������������C���s���t��d�S�)N)�EOFError)r3���r!���r!���r"���� handle_EOF���s����zMyRPCClient.handle_EOFN)r����r����r����r����r!���r!���r!���r"���r����~��s���r����c���������������@���s��e�Zd�Zdd��ZdZdZdZdd��Zdd��Zdd ��Z d?dd �Z dd��Zdd��Zdd��Z dd��Zd@dd�ZdZdd��ZdZdd��Zdd��Zdd��Zd d!��Zd"Zd#d$��ZdAd%d&�Zd'd(��Zd)d*��Zd+d,��ZdBd-d.�Zd/d0��Zd1d2��Zd3d4��Z d5d6��Z!d7d8��Z"d9d:��Z#d;d<��Z$d=d>��Z%dS�)C�ModifiedInterpreterc�������������C���sH���||�_�tjd�j}tj|�|d��d�|�_d|�_d�|�_t |�_ |�jjj |�_d�S�)N�__main__)�localsF)� tkconsole�sys�modules�__dict__r���r6����save_warnings_filters� restarting�subprocess_arglist�PORT�port�compile�compiler�flags�original_compiler_flags)r3���r����r����r!���r!���r"���r6������s����zModifiedInterpreter.__init__Nc�������������C���s&���|�j�d�kr|�j��|�_�tj|�j��|�_d�S�)N)r�����build_subprocess_arglist� subprocess�Popen� rpcsubproc)r3���r!���r!���r"����spawn_subprocess���s���� z$ModifiedInterpreter.spawn_subprocessc�������������C���s^���dd��t�jD��}tjdddddd�}td kr8d |f�}n d|f�}t�jg|�d|t|�j�g�S�) Nc�������������S���s���g�|�]}d�|��qS�)z-Wr!���)�.0�sr!���r!���r"���� <listcomp>���s����z@ModifiedInterpreter.build_subprocess_arglist.<locals>.<listcomp>�main�Generalzdelete-exitfuncF�bool)�default�typezidlelib.pyshellz&__import__('idlelib.run').run.main(%r)z__import__('run').main(%r)z-c)r�����warnoptionsr���� GetOptionr����� executablers���r����)r3���rj���Z del_exitfZcommandr!���r!���r"���r�������s���� z,ModifiedInterpreter.build_subprocess_arglistc�������������C���sZ��t�|�jf}xLtd�D�]4}tj|��yt|�|�_P�W�q�tk rF���Y�qX�qW�|�j���d�S�|�jj j ��d�|�_tdkr�|�jj jt jt jd��|�j���|�jj jd��y|�jj���W�n�t jk r����|�j���d�S�X�|�jjd|�j��|�jjd|�jj��|�jjd|�jj��|�jjd|�jj��|�jjd |�jj��|�jjd t��|�jjd|���|�jdd ��|�j���|�jS�)N����r���r���� ���r����r����r����r����r;���r)���r^���T)�with_cwd)�HOSTr����r�����timeZsleepr�����rpccltr����display_port_binding_error�listening_sockZgetsocknamer����Z setsockopt�socketZ SOL_SOCKETZSO_REUSEADDRr����Z settimeout�accept�timeout�display_no_subprocess_error�registerr����r����r����r����r;���r)���� transfer_path�poll_subprocess)r3���Zaddr�ir!���r!���r"����start_subprocess���s>���� z$ModifiedInterpreter.start_subprocessFrR���c�������������C���sT��|�j�r|�jS�d|�_�|�j��}|r<ytj|�j��W�n���Y�nX�|�jj���|�j���|�j}|j}d|_|�j ���y|�jj ���W�n�tjk r����|�j ���d�S�X�|�j|d��|j���|jjdd��d|r�|nd�}t|j�t|��d�d �d �}|jdj||���|jjdd��|jjdd ��|�s"|j���|�r<tj|�j��|j���|�j|�jj_d|�_�|�jS�)NTF)r����r����zend-1cz RESTART: ZShell����r����rk���z {0} {1} {0}�restart�left) r����r�����getdebuggerr���Zclose_subprocess_debugger�close�terminate_subprocessr����� executingr����r����r����r����r����r����� stop_readliner7���r����rc����widthr~���r����format�mark_set�mark_gravity� showpromptZrestart_subprocess_debugger�load_breakpointsr����r����r����r����)r3���r����r���r_���r����Z was_executingr����Zhalfbarr!���r!���r"����restart_subprocess���sH���� z&ModifiedInterpreter.restart_subprocessc�������������C���s���|�j�jddf�i���d�S�)N�execZinterrupt_the_server)r����Z remotecall)r3���r!���r!���r"���Z__request_interrupt��s����z'ModifiedInterpreter.__request_interruptc�������������C���s���t�j|�jd�j���d�S�)N)�target)� threadingZThread�'_ModifiedInterpreter__request_interrupt�start)r3���r!���r!���r"����interrupt_subprocess��s����z(ModifiedInterpreter.interrupt_subprocessc�������������C���s~���|�j�d�k r|�jjj|�j���y|�jjj���W�n�tk r>���Y�nX�y|�jj���W�n�tk rb���Y�nX�|�j���d|�j_ d�|�_d�S�)NF) �_afteridr����r7���Zafter_cancelr����r����r����r���r����r����)r3���r!���r!���r"����kill_subprocess��s���� z#ModifiedInterpreter.kill_subprocessc�������������C���sL���y|�j�j���W�n�tk r"���d�S�X�y|�j�j���W�n�tk rF���d�S�X�d�S�)N)r�����killr����wait)r3���r!���r!���r"���r������s����z(ModifiedInterpreter.terminate_subprocessc�������������C���s2���|rdg}|j�tj��ntj}|�jd|f���d�S�)NrR���zRif 1: import sys as _sys _sys.path = %r del _sys )�extendr����r>���� runcommand)r3���r����r>���r!���r!���r"���r����#��s����z!ModifiedInterpreter.transfer_pathc�������������C���s6��|�j�}|d�krd�S�y|j|�jdd�}W�n2�tttfk rX���|�jjrHd�S�d�}|�j���Y�nX�|�r|�jj ���d�|�_|\}}|�jj }|dkr�|d�k r�tt|�|d��nH|dkr�|�jj d�r�|�j���n*|dkr�d}t||tjd��t|||d��y|�jj���W�n�tk �r���Y�nX�|�jj�s2|�jjj|�jj|�j�|�_d�S�) Ng�������?)r����ZOK)r���Z EXCEPTIONz<<toggle-jit-stack-viewer>>�ERRORz/pyshell.ModifiedInterpreter: Subprocess ERROR: )r����Zpollresponse� active_seqr����r����KeyboardInterruptr�����closingr�����resetoutputr�����print�repr�getvar�remote_stack_viewerr����� __stderr__�endexecutingr���r7����after�pollintervalr����r����)r3���Zclt�responseZhowZwhatr�����errmsgr!���r!���r"���r����2��s@���� z#ModifiedInterpreter.poll_subprocessc�������������C���s ���||�_�d�S�)N)r ���)r3���r ���r!���r!���r"����setdebuggerZ��s����zModifiedInterpreter.setdebuggerc�������������C���s���|�j�S�)N)r ���)r3���r!���r!���r"���r����]��s����zModifiedInterpreter.getdebuggerc�������������C���s���|�j�jjd|�j��d�S�)Ni,��)r����r7���r����r����)r3���r!���r!���r"����open_remote_stack_viewer`��s���� z,ModifiedInterpreter.open_remote_stack_viewerc�������������C���s����ddl�m}�|�jjddd i��}|d�kr6|�jjj���d�S�|j|�j|�}ddlm }m }�t|�jj�}tj ��}tj|d�d�}|||dd �} | jjd dd��|| jd�|�} | j���d�S�)Nr���)� debugobj_rr����Zstackviewerr;���)�ScrolledCanvas�TreeNodeZnormalrT���)�bgZhighlightthicknessr���Zboth)�expand�fill)r;���)�idlelibr��r�����remotequeuer����ru���rb���ZStubObjectTreeItemZidlelib.treer��r��ZToplevelr���rV���rW����frame�packZcanvasr��)r3���r��Zoid�itemr��r��r����rX���rT���ZscZnoder!���r!���r"���r����m��s����z'ModifiedInterpreter.remote_stack_viewerr���c�������������C���s���|�j�|�}|�j||��d�S�)N)�stuffsource�execfile)r3����sourcer���r!���r!���r"���� execsource���s���� zModifiedInterpreter.execsourcec�������������C���s����|d�krFt�j|��.}|j��}tr<dtjj|���d�|�d�}W�d�Q�R�X�yt||d�}W�nH�tt fk r����|�j j���td|�j j d��tj|�|��|�j j���Y�nX�|�j|��d�S�)Nz__file__ = r'''z''' z del __file__r����zB*** Error in script or command! Traceback (most recent call last):)r���)�tokenizero����read�use_subprocessr=���r>����abspathr����� OverflowError�SyntaxErrorr����r����r����r����r����showsyntaxerrorr�����runcode)r3���r���r��rx����coder!���r!���r"���r�����s����& zModifiedInterpreter.execfilec���������� ���C���sd���|�j�|�}d|�_tjd�d���|�_tjdtd��ztj|�||�S�|�jd�k r^|�jtjd�d��<�d�|�_X�d�S�)Nr����error)�actionr���) r ��Zmorer%����filtersr�����filterwarnings� SyntaxWarningr���� runsource)r3���r��r���r!���r!���r"���r�����s���� zModifiedInterpreter.runsourcec�������������C���s>���d|�j��}|�j�d�|�_�|jd�}t|�d�d||ftj|<�|S�)Nz<pyshell#%d>r���rl���r���)�gid�splitr~���r)���r*���)r3���r��r���ry���r!���r!���r"���r �����s ���� zModifiedInterpreter.stuffsourcec�������������C���s���|�j�d|f���d�S�)Na(��if 1: _filename = %r import sys as _sys from os.path import dirname as _dirname _dir = _dirname(_filename) if not _dir in _sys.path: _sys.path.insert(0, _dir) del _filename, _sys, _dirname, _dir )r����)r3���r���r!���r!���r"����prepend_syspath���s����z#ModifiedInterpreter.prepend_syspathc�������������C���s����|�j�}|j}|jddd��tj��\}}}t|dd�p:|p:d}t|dd�pJd}t|d d�pZd } | d krl|d7�}|dkr�d| d��} nd|d�| d�f�} |j|| ��|j���|�jd |���|j ���d�S�)Nr����z1.0r�����msgrR���z<no detail available>r ���r����offsetr���ziomark + %d charsz&iomark linestart + %d lines + %d charszSyntaxError: %s ) r����r7���rg���r�����exc_infort���Zcolorize_syntax_errorr����r���r����)r3���r���r����r7���r�����value�tbr#��r ���r$���posr!���r!���r"���r�����s"����z#ModifiedInterpreter.showsyntaxerrorc�������������C���s6���|�j�j���|�j���tj|���|�j�jd�r2|�j�j���d�S�)Nz<<toggle-jit-stack-viewer>>)r����r�����checklinecacher���� showtracebackr�����open_stack_viewer)r3���r!���r!���r"���r*�����s ���� z!ModifiedInterpreter.showtracebackc�������������C���sB���t�j}x6t|j���D�]&}|d�d��|dd����dkr||=�qW�d�S�)Nr���z<>r(���)r)���r*���r+����keys)r3����cr/���r!���r!���r"���r)�����s����z"ModifiedInterpreter.checklinecachec�������������C���s@���|�j�jr|�j���dS�|�jr0|�jjdd|fi���nt||�j��dS�)Nr���r����r��r���)r����r�����display_executing_dialogr����r ��r����r����)r3���r��r!���r!���r"���r�������s����zModifiedInterpreter.runcommandc�������������C���st��|�j�jr|�jj���|�j���|�jd�k r:|�jtjd�d��<�d�|�_|�j}��z�yV|�j�j ���|�rx|�j d�k rx|�j jdd|fi��|�_n |r�|j ||�j��nt||�j��W�n��tk r����|�j�js�tjddd|�j�jd�r̂�q�|�j���n��Y�nb���t�rtd|�j�jd��|�j���|�j�j���n,|�j�j�r0d |�j�_td |�j�jd��n|�j���Y�nX�W�d�t�sny|�j�j���W�n�tk �rl���Y�nX�X�d�S�)Nr����r��zExit?zDo you want to exit altogether?�yes)r����r���z IDLE internal error in runcode())r���Fr����)r����r����r^���r����r)��r����r%���r��r ����beginexecutingr����Z asyncqueuer����Zrunr����r����� SystemExitr����rv���Zaskyesnor7���r*��r��r����r����r�����canceledr���)r3���r��r ���r!���r!���r"���r�����sP���� zModifiedInterpreter.runcodec�������������C���s���|�j�jj|�S�)N)r����r����r���)r3���r����r!���r!���r"���r���+��s����zModifiedInterpreter.writec�������������C���s���t�jdd|�jjd��d�S�)NzPort Binding ErroraA��IDLE can't bind to a TCP/IP port, which is necessary to communicate with its Python execution server. This might be because no networking is installed on this computer. Run IDLE with the -n command line switch to start without a subprocess and refer to Help/IDLE Help 'Running without a subprocess' for further details.)r���)rv���rw���r����r7���)r3���r!���r!���r"���r����/��s����z.ModifiedInterpreter.display_port_binding_errorc�������������C���s���t�jdd|�jjd��d�S�)NzSubprocess Startup Errorz�IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection.)r���)rv���rw���r����r7���)r3���r!���r!���r"���r����:��s����z/ModifiedInterpreter.display_no_subprocess_errorc�������������C���s���t�jdd|�jjd��d�S�)NzAlready executingzYThe Python Shell window is already executing a command; please wait until it is finished.)r���)rv���rw���r����r7���)r3���r!���r!���r"���r.��B��s����z,ModifiedInterpreter.display_executing_dialog)FrR���)F)N)N)&r����r����r����r6���r����r����r����r����r����r����r����r����r����r����r����r����r����r����r ���r���r����r��r����r ��r��r��r��r ��r"��r��r*��r)��r����r��r���r����r����r.��r!���r!���r!���r"���r�������sF��� + - & 1r����c�������������������s���e�Zd�Zde���d�ZeZeZdZd[d\d]d^d_gZ e jd`g�Zddlm Z �dadd�Zdd��ZdZdZdZdZdZdZdd��Zdd��Zdbdd�Zdd ��Zdcd!d"�Zd#d$��Zd%d&��Zd'd(��Zd)d*��Zd+d,��Zd-d.��Z d/d0��Z!d1d2��Z"d3Z#d4d5��Z$d6d7��Z%d8d9��Z&d:d;��Z'ddd<d=�Z(d>d?��Z)d@dA��Z*dBdC��Z+dDdE��Z,dFdG��Z-dedHdI�Z.dfdJdK�Z/dgdLdM�Z0dNdO��Z1dPdQ��Z2dRdS��Z3f�fdTdU�Z4��fdVdW�Z5��fdXdY�Z6���Z7S�)hr����zPython z Shellr����_File�edit�_Editr_����_Debug�options�_Options�window�_Window�help�_Help�Squeeze�<<squeeze-current-text>>r���)�HistoryNc���������� ���C���s���t�r&|�j}|d�d�dkr&|jdd��t|��|�_|d�krVt��}t|��|j���t|�}t j |�|d�d���d|�_d|�_t td�r�tjnd|�_|�jjd �d�|�_|�j|�_|�j}|jdd��|jd |�j��|jd|�j��|jd|�j��|jd|�j��|jd|�j��|jd|�j��|jd|�j��t��r8|jd|�j��|jd|�j��tj |�_!tj"|�_#tj$|�_%ddl&m'}�t(|�d|j)�|�_$t*|�d|j)�|�_ t*|�d|j)�|�_"t*|�d|j)�|�_+t��s�|�j t_ |�j"t_"|�j$t_$ydd�l,}|j-|_.W�n���tj/t_"��Y�nX�|�j0|�j�|�_1d|�_2d�S�)Nr����r����shell�She_llT�����ps1z>>> rl���r����char)�wrapz<<newline-and-indent>>z<<plain-newline-and-indent>>z<<interrupt-execution>>z<<end-of-file>>z<<open-stack-viewer>>z<<toggle-debugger>>z<<toggle-jit-stack-viewer>>z<<view-restart>>z<<restart-shell>>)�iomenur����r����r����r�����2���)r@��rA��r(���)3r��� menu_specsra���r����r^����Tkr����withdrawr����r���r6���ZusetabsZindentwidth�hasattrr����rC���sys_ps1r!��Zprompt_last_line�promptr7���Z configurer8����enter_callback�linefeed_callback�cancel_callback�eof_callbackr+���toggle_debugger�toggle_jit_stack_viewer�view_restart_mark� restart_shellr�����save_stdoutr�����save_stderrr����� save_stdinr��rF��r����encodingr���r�����pydocZ plainpagerZpagerr����r?���historyr����)r3���r;����msru���r7���rF��rZ��r!���r!���r"���r6���d��s`���� zPyShell.__init__c�������������C���s���t�jdd�S�)NT)Z shell_only)r���Z GetExtensions)r3���r!���r!���r"����get_standard_extension_names���s����z$PyShell.get_standard_extension_namesFc�������������C���s���|a�d�S�)N)r���)r3����streamr!���r!���r"����set_warning_stream���s����zPyShell.set_warning_streamc�������������C���s���t�S�)N)r���)r3���r!���r!���r"����get_warning_stream���s����zPyShell.get_warning_streamc�������������C���sH���|�j�r$tjdd|�jd��|�j���dS�|�jj��}|r<|�j���n|�j���d�S�)NzDon't debug nowz*You can only toggle the debugger when idle)r���rQ���) r����rv���rw���r7����set_debugger_indicatorr^���r�����close_debugger� open_debugger)r3���re����dbr!���r!���r"���rR�����s���� zPyShell.toggle_debuggerc�������������C���s���|�j�j��}|�jd|����d�S�)Nz<<toggle-debugger>>)r^���r����Zsetvar)r3���rd��r!���r!���r"���ra�����s���� zPyShell.set_debugger_indicatorc�������������C���s���d�S�)Nr!���)r3���re���r!���r!���r"���rS�����s����zPyShell.toggle_jit_stack_viewerc�������������C���sh���|�j�j��}|r\|�j�jd���|j���|�j�jr8tj|�j�j��|�j���|�jj d��|�j |�_|�j���|�j ���d�S�)Nz[DEBUG OFF] )r^���r����r���r����r����r���Zclose_remote_debuggerr����r����r���rL��rM��r����ra��)r3���rd��r!���r!���r"���rb�����s���� zPyShell.close_debuggerc�������������C���sX���|�j�jrtj|�j�j|��}n tj|��}|�j�j|��|j���d|�j�|�_ |�j ���|�j���d�S�)Nz[DEBUG ON] )r^���r����r���Zstart_remote_debuggerr ���ZDebuggerr���r����rL��rM��r����ra��)r3���Zdbg_guir!���r!���r"���rc�����s���� zPyShell.open_debuggerc�������������C���s���|�j����d|�_d�S�)Nr���)r����r����)r3���r!���r!���r"���r0�����s����zPyShell.beginexecutingc�������������C���s���d|�_�d|�_|�j���d�S�)Nr���)r����r2��r����)r3���r!���r!���r"���r�������s����zPyShell.endexecutingc�������������C���sD���|�j�r&tjddd|�jd�}|dkr&dS�|�j���d|�_d|�_tj|��S�)NzKill?z7Your program is still running! Do you want to kill it?�ok)r����r���FZcancelT) r����rv���Zaskokcancelr7���r����r2��r����r���r����)r3���r����r!���r!���r"���r�������s���� z PyShell.closec�������������C���sV���|�j����tr|�jj���|�jt_|�jt_|�j t_ d�|�_d�|�_d�|�j_ d�|�_tj|���d�S�)N)rb��r��r^���r����rV��r����r����rW��r����rX��r����r����r;���r]���r[��r���r����)r3���r!���r!���r"���r�������s���� zPyShell._closec�������������C���s���dS�)NTr!���)r3���r���r!���r!���r"����ispythonsource ��s����zPyShell.ispythonsourcec�������������C���s���|�j�S�)N)�shell_title)r3���r!���r!���r"����short_title ��s����zPyShell.short_titlezHType "help", "copyright", "credits" or "license()" for more information.c�������������C���s����|�j�jdd��|�j���tr:d}|�jj��}|sF|�j���dS�nd}tjt _|�j d t jt j|�j |f���|�j�j���|�j���d d�l}d�|_dS�)Nr����ra���rR���Fz==== No Subprocess ==== z9WARNING: Running IDLE without a Subprocess is deprecated z;and will be removed in a later version. See Help/IDLE Help zfor details. zPython %s on %s %s %sr���TzR==== No Subprocess ==== WARNING: Running IDLE without a Subprocess is deprecated z�==== No Subprocess ==== WARNING: Running IDLE without a Subprocess is deprecated and will be removed in a later version. See Help/IDLE Help z�==== No Subprocess ==== WARNING: Running IDLE without a Subprocess is deprecated and will be removed in a later version. See Help/IDLE Help for details. )r7���r����r����r��r^���r����r����r����displayhookr����r����version�platform� COPYRIGHTZfocus_forcer�����tkinterZ _default_root)r3���ZnosubZclientrm��r!���r!���r"���r������s$���� � z PyShell.beginc�������������C���s���|�j�s d�S�d|�_|�jj���d�S�)NT)�reading�_stop_readline_flagr�����quit)r3���r!���r!���r"���r����+��s����zPyShell.stop_readlinec�������������C���s����|�j�}zd|�_�|�jj���W�d�||�_�X�|�jr4d|�_dS�|�jjdd�}t|�dkrRd}|�j���|�jrnd|�_t snt �|�jr~d|�_d}|S�)Nr���FrR���r����zend-1cr���rl���)rn��r�����mainloopro��r7����getr~���r����r2��r��r����� endoffile)r3���r.���r���r!���r!���r"����readline1��s(����zPyShell.readlinec�������������C���s���dS�)NTr!���)r3���r!���r!���r"����isattyH��s����zPyShell.isattyc���������� ���C���s����y|�j�jddd�rd�S�W�n���Y�nX�|�jp0|�jsR|�j���|�jjd��|�j���dS�d|�_d|�_ |�jr�|�jj r�|�jj��r�|�jj���n |�jj ���|�jr�|�jj���dS�)Nz sel.firstz!=zsel.lastzKeyboardInterrupt rQ���r���r���)r7���r����r����rn��r����r^���r���r����rs��r2��r����r����r����r����r����rp��)r3���re���r!���r!���r"���rP��K��s&���� zPyShell.cancel_callbackc�������������C���sh���|�j�r|�j�rd�S�|�jjddd�o0|�jjddd�s6d�S�|�j�sN|�j���|�j���nd|�_d|�_|�jj ���dS�)Nr����z==ra���zend-1cr���r���rQ���) r����rn��r7���r����r����r����r2��rs��r����rp��)r3���re���r!���r!���r"���rQ��a��s���� zPyShell.eof_callbackc�������������C���s0���|�j�r"|�jjdd��|�jjd��n |�j|��dS�)Nra���rl���rQ���)rn��r7���ra����see�newline_and_indent_event)r3���re���r!���r!���r"���rO��p��s ���� zPyShell.linefeed_callbackc�������������C���s<��|�j�r|�j�rd�S�y6|�jjdd�}|rF|�jjddd�rF|�j||��dS�W�n���Y�nX�|�jjddd��rX|�jjd d�}|r�|�jjdd|d ��r�|�j|�jj|d�|d ��|��dS�|�jjd d�}|r�|�jjdd |d��r�|�j|�jj|d�|d ��|��dS�|�jjdd�}|�r>|�jj|d�dd��r>|�j|�jj|d �d�|��n|�j|�jjdd�|��dS�|�jjddd��rx|�jjdd��|�jjdd�}|�r�|j ����r�|�jj dd��|�jjddd��r�|�j|��dS�|�jjdd��|�j�r�|�jjdd��|�jj d��n |�j|��|�jjd dd��|�jj���|�j�r0|�jj���n|�j���dS�)Nz sel.firstzsel.lastz<=r����rQ���ra���r����ziomark linestartr����r���r���zinsert lineendz>=r����zinsert linestartzend-1czend-1c linestartrl���)r����rn��r7���rr��r�����recallZ tag_prevrangeZ tag_nextranger�����stripr����rw��ra���rv��rY���Zupdate_idletasksr����rp���runit)r3���re����sel�prev�next�indicesr����r!���r!���r"���rN��y��sX���� zPyShell.enter_callbackc�������������C���s<��t�jdd|�}t�jdd|�}|jd�}|�jj���z�|�jjddd��|�jjdd ��|�jjd d�}|j��j d�r�|�j |��|�jjd d�}|�jjd|d�j����t |�d k�rt�jd|d��jd�}t�jd|�jd�}xJ|d d���D�]:}|j|��r||t |�d����}|�jjdd|j�����q�W�W�d�|�jjd��|�jj���X�d�S�)Nz^\s*\nrR���z\n\s*$rl���r{��z1.0r����ra���zend-1czinsert linestart�:r���r���z ^([ \t]*))�re�subr!��r7���Zundo_block_startrg���r����rr���rstrip�endswithrw��ra���ry��r~����search�grouprq���rv��Zundo_block_stop)r3���r����re���ry����prefixZorig_base_indentZnew_base_indentr���r!���r!���r"���rx�����s*���� zPyShell.recallc�������������C���s����|�j�jdd�}t|�}x$|dkr:||d��dkr:|d�}qW�|dkr\||d��dkr\|d�}x$|dkr�||d��dkr�|d�}q^W�|d�|��}|�jj|��d�S�)Nr����zend-1cr���r���z rl���)r7���rr��r~���r^���r��)r3���r���r����r!���r!���r"���rz�����s����z PyShell.runitc�������������C���sX���|�j�jr|�j�j��S�y tj�W�n���tjdd|�jd��d�S�ddlm }�||�j |�j��d�S�)NzNo stack tracez@There is no stack trace yet. (sys.last_traceback is not defined))r���r���)�StackBrowser)r^���r����r����r�����last_tracebackrv���rw���r7���Zidlelib.stackviewerr���ru���r;���)r3���re���r���r!���r!���r"���r+�����s���� zPyShell.open_stack_viewerc�������������C���s���|�j�jd��|�j�jd��d�S�)Nr����r����)r7���rv��)r3���re���r!���r!���r"���rT�����s����zPyShell.view_restart_markc�������������C���s���|�j�jdd��d�S�)NT)r����)r^���r����)r3���re���r!���r!���r"���rU�����s����zPyShell.restart_shellc�������������C���s:���|�j����|�jj|�j��|�jjdd��|�j���|�jj���d�S�)Nra���zend-1c) r����r����r���rM��r7���r�����set_line_and_columnrA���Z reset_undo)r3���r!���r!���r"���r�������s ����zPyShell.showpromptc�������������C���sP���|�j�jj}t|ddd�}dj|j|��}|jd�s:|d7�}|�jjj d|d��d�S�)NrB��T)r�����tabsize�expand_tabsrl���ziomark linestartr����) r^���r����r����r ���r?���rE��r���ZperZbottomra���)r3���r#��r�����wrapperZwrapped_msgr!���r!���r"����show_warning���s���� zPyShell.show_warningc�������������C���sX���|�j�jdd�}|�jr |�jj|��|�j�jd�dkr>|�j�jdd��|�j�jdd��|�j���d�S�)Nr����zend-1czend-2crl���)r7���rr��r[���storera���r����r���)r3���r��r!���r!���r"���r������s����zPyShell.resetoutputc�������������C���s����t�|t�rRt|�rRt|�dkrRxt|�D�]\}}|dkr(P�q(W�td|||d�d��y0|�jjdd��tj |�||d�}|�jjdd��W�n�����Y�nX�|�j r�d|�_ ts�t�|S�) Nu���zUCS-2r���z%Non-BMP character not supported in Tkr�����rightr����r���) � isinstancers���r~����max� enumerate�UnicodeEncodeErrorr7���r����r���r���r2��r��r����)r3���r����r����r����rD���countr!���r!���r"���r�����s"����z PyShell.writec����������������s8���y|�j�jddd�rdS�W�n�tk r,���dS�X�t��j��S�)Nz sel.firstr����r�����disabled)r7���r����r�����superrF���)r3���)� __class__r!���r"���rF���&��s����zPyShell.rmenu_check_cutc����������������s���|�j�jddd�rdS�t��j��S�)Nra���r����r����r���)r7���r����r���rL���)r3���)r���r!���r"���rL���.��s����zPyShell.rmenu_check_paste)r���r3��)r4��r5��)r_���r6��)r7��r8��)r9��r:��)r;��r<��)r=��r>��)N)N)N)N)N)N)N)8r����r����r����r ���rg��r����r���r����r���rH��r���r����Zidlelib.historyr?��r6���r]��rn��r����r2��rs��r����ro��r_��r`��rR��ra��rS��rb��rc��r0��r����r����r����rf��rh��rl��r����r����rt��ru��rP��rQ��rO��rN��rx��rz��r+��rT��rU��r����r���r����r���rF���rL���� __classcell__r!���r!���)r���r"���r����J��sj��� < ? r����c�������������C���s6���|�j�dkr2x&dD�]}|�j|dd|�j|d����qW�d�S�)NZx11�Text�Entry�Spinboxz <<Paste>>z%catch {%W delete sel.first sel.last} )r���r���r���)Z_windowingsystemZ bind_class)ru����clsr!���r!���r"���� fix_x11_paste4��s���� r���a��� USAGE: idle [-deins] [-t title] [file]* idle [-dns] [-t title] (-c cmd | -r file) [arg]* idle [-dns] [-t title] - [arg]* -h print this help message and exit -n run IDLE without a subprocess (DEPRECATED, see Help/IDLE Help for details) The following options will override the IDLE 'settings' configuration: -e open an edit window -i open a shell window The following options imply -i and will open a shell: -c cmd run the command in a shell, or -r file run script from file -d enable the debugger -s run $IDLESTARTUP or $PYTHONSTARTUP before anything else -t title set title of shell window A default edit window will be bypassed when -c, -r, or - are used. [arg]* are passed to the command (-c) or script (-r) in sys.argv[1:]. Examples: idle Open an edit window or shell depending on IDLE's configuration. idle foo.py foobar.py Edit the files, also open a shell if configured to start with shell. idle -est "Baz" foo.py Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell window with the title "Baz". idle -c "import sys; print(sys.argv)" "foo" Open a shell window and run the command, passing "-c" in sys.argv[0] and "foo" in sys.argv[1]. idle -d -s -r foo.py "Hello World" Open a shell window, run a startup script, enable the debugger, and run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in sys.argv[1]. echo "import sys; print(sys.argv)" | idle - "foobar" Open a shell window, run the script piped in, passing '' in sys.argv[0] and "foobar" in sys.argv[1]. c�����������������s\��dd�l�}�ddlm}�ddlm}�ddlm}�td��dad}d}d}d�}d�}d} y|�j�tj dd���d�\} }W�nD�|�j k r��}�z&td |tf�tj d ��tjd��W�Y�d�d�}~X�nX�x�| D�]�\} }| dkr�|}d}| d kr�d}d}| dkr�d}| dk�rtjjt��tj���| dk�rd}| dk�r6tdtj d ��da| dk�rj|}tjj|��rTntd|��tj���d}| dk�r|d} d}| dkr�|t_d}q�W�|�r�|d�dk�r�tjj��}d}x0tttj��D�]}tjjtj|��tj|<��q�W�|�r|d�dk�rdg|dd����t_ n�|�r$dg|�t_ n�|�r8|g|�t_ n�|�r�d}g�}x |D�]}|jtjj|����qLW�xX|D�],}tjj|�}|tjk�rntjjd|���qnW�n"tj��}|tjk�r�tjjd|��tj ddddd�}|�p�|}|�p�|�}t�r�|��r�t!���t"dd�a#t#j$���dd l%m&}�|t#��tjj'tjjt(�d!��|��d"k�rbtjj'�d#�}t#j)|d$��nBt*d%k�rpd&nd'�����fd(d)�d1D��}d-d)��|D��}t#j+d2|����t,t#��t-t#��t.t#�a/|j0t#t/��|�r|�p�|�sx0|d�d���D�] }t/j1|�d�k�r�|j2|���q�W�|�st/j3���|�rPt/j4��}|�s2d�S�|j5���rVt/j6�rV|j7j8���nt/j9}|�rd|j:���| �r�tj;j<d.��p�tj;j<d/�}|�r�tjj|��r�|j=j>|��|�s�|�r�|j=j?d0tj f���|�r�|j=j@|��n|�r0|j=jA|��|j=j>|��n8|�r0|jBt#�}|�r|jC|��|jD��}|�r0|jC|��xt/jE�rFt#jF����q2W�t#jG���td��d�S�)3Nr���)�system)�testing)�macosxTFr���zc:deihnr:st:zError: %s %s)r���r����z-cz-dz-ez-hz-iz-nz: Warning: running IDLE without a subprocess is deprecated.z-rzNo script file: z-sz-t�-rR���r����r����zeditor-on-startupr����)r����ZIdle)Z className)r���ZIconsZWindowszidle.ico)r����g333333!@z.pngz.gifc����������������s"���g�|�]}t�jj�d�|��f���qS�)z idle_%d%s)r=���r>���r?���)r�����size)�ext�icondirr!���r"���r�������s���zmain.<locals>.<listcomp>����� ����0���c�������������S���s���g�|�]}t�t|d���qS�))Zmasterr���)Z PhotoImageru���)r�����iconfiler!���r!���r"���r�������s���ZIDLESTARTUPZ PYTHONSTARTUPzbif 1: import sys as _sys _sys.argv = %r del _sys )r���r���r���)T)H�getoptrk��r���r��r���r���r'���r��r�����argvr��r����� usage_msgr�����exitr����r���r=���r>���r|���r����rg��r����r��r����r~���r��r\����dirnamera����getcwdr���r����Z NoDefaultRootrI��ru���rJ���idlelib.runr���r?����__file__Z wm_iconbitmap� TkVersionZwm_iconphotor���r���r����r;���ZsetupAppro���rf����newr<���ZisAquaTk�dictr�����lowerr]���rc���environrr��r^���r��r����r��r"��ZtkVersionWarningr���ZpreferTabsPreferenceWarningZinversedictrq��Zdestroy)r���r���r���r���Zenable_shellZenable_editr_����cmdZscriptZstartupZoptsrC���r#���o�ar����Zpathxr����dirZ edit_startr���r���Z iconfilesZiconsr@��ZtkversionwarningZprefer_tabs_preference_warningr!���)r���r���r"���r����u��s��� r����r����r]���F)NN)Or����rm���ImportErrorr����r����r1��rk��ZctypesZPROCESS_SYSTEM_DPI_AWAREZOleDLLZSetProcessDpiAwarenessr���r���Ztkinter.messageboxZ messageboxrv���r���rI��ru���rJ��r���r���rw���r��r���r)���r=���Zos.pathr ���r���r����r�����textwrapr ���r����r����r��r%���Zidlelib.colorizerr���Zidlelib.configr���r��r ���r���Zidlelib.editorr���r���Zidlelib.filelistr���Zidlelib.outwinr���r���r���r���r���Zidlelib.undor���r����r����r���r#���r$���r'���� checkcacher0���r1���r����r����r����Z RPCClientr����r����r����r���r���r����r����r����r!���r!���r!���r"����<module>���s���� �>���H���m?�1