Sindbad~EG File Manager

Current Path : /proc/2714517/root/usr/lib64/python3.6/turtledemo/__pycache__/
Upload File :
Current File : //proc/2714517/root/usr/lib64/python3.6/turtledemo/__pycache__/__main__.cpython-36.opt-2.pyc

3

0�Qg�7�@sddlZddlZddlTddlmZmZddlmZddlm	Z	ddl
mZddl
Z
ejjejje��ZejdkZdZd	Zd
ZdZdZd
defZd(ZdddgZdZdZdddddddddddgZ dd�Z!d efd!efd"e
jffZ"Gd#d$�d$e#�Z$d%d&�Z%e&d'k�re%�dS))�N)�*)�ColorDelegator�color_config)�
Percolator)�	view_text)�__doc__�darwin������Arial��boldzLucida Console�
�normal��d��	�������cCsdd�tjt�D�S)NcSs.g|]&}|jd�r|ddkr|dd��qS)z.pyr�_Nr���)�endswith)�.0�entry�r#�+/usr/lib64/python3.6/turtledemo/__main__.py�
<listcomp>tsz%getExampleEntries.<locals>.<listcomp>)�os�listdir�demo_dirr#r#r#r$�getExampleEntriesssr)zTurtledemo helpzAbout turtledemozAbout turtle modulec@s�eZdZd(dd�Zdd�Zdd�Zdd	�Zd
d�Zd)dd
�Zd*dd�Z	dd�Z
d+dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS),�
DemoWindowNc	CsJt�|_}t_|jd�|jd|j�trbddl}|j	dddddj
tj��ddg|j
|j
d	�|jdd
d�|jdd
d�|jd
dd
d
�|jddd
d
�|jddd
d
�t|tdd�|_|jj|j|j�ddd�|jj|j|j�ddd�|jj|j|j�ddd�|j|d<ttdtdd�}|j|j|��|j|j|��|jdddd�t|d
ddd.dtd!�|_ t!|d"t"d#d$|j#d%�|_$t!|d&t"d#d$|j%d%�|_&t!|d't"d#d$|j'd%�|_(|j jd
ddd/d(�|j$jd
d
d)d*�|j&jd
dd)d*�|j(jd
dd)d*�t)|j*�j+t,��d+|_-d+|_.|�r.|j/|�|j0t1t1t1d,d-�t2|_3dS)0NzPython turtle-graphics examplesZWM_DELETE_WINDOWrZ	osascriptz-ez tell application "System Events"z>set frontmost of the first process whose unix id is {} to truezend tell)�stderr�stdoutr	)�weight�Z)Zminsizer-r
r)�relief�borderwidthZExamples)�menu�label�	underlineZFontsizeZHelpr1r
z#ddd)�orientZ	sashwidthZ
sashrelief�bgrZnews)�rowZ
columnspan�stickyz --- z#ddfr�r)Zheight�textr5�fontr0r/z START Zwhitez#fed)r9r:�fgZdisabledforeground�commandz STOP z CLEAR )r6�columnr7�padxZew)r6r=r7FzChoose example from menu�black)rr8r)rr
)4ZTk�root�turtle�_root�titleZwm_protocol�_destroyr�
subprocessZrun�formatr&�getpidZDEVNULLZgrid_rowconfigureZgrid_columnconfigure�MenuZRAISEDZmBarZadd_cascade�makeLoadDemoMenu�makeFontMenu�makeHelpMenuZPanedWindow�
HORIZONTALZSOLID�add�
makeTextFrame�makeGraphFrameZgridZLabelZRIDGE�
output_lblZButton�btnfont�	startDemo�	start_btn�stopIt�stop_btn�clearCanvas�	clear_btnrr9Zinsertfilterr�dirty�exitflag�loadfile�	configGUI�DISABLED�STARTUP�state)�self�filenamer@rEZpaner#r#r$�__init__�sn










zDemoWindow.__init__cCsP|jj�}|jj�}|jjd|j||j�|jjd|j||j�dS)Ng�?)�_canvasZwinfo_widthZwinfo_heightZxview_moveto�	canvwidthZyview_moveto�
canvheight)r_�eventZcwidthZcheightr#r#r$�onResize�s

zDemoWindow.onResizecCs6t|�|_}t|ddddd�|_}t|�t|dd�|_}|j|d<|jt	t
d	�t|d
td�|_}|j
|d<|jttd	�|j|d<|j|d
<tt�|d<tr�dnd}|jd||j�|jd||j�|jd||j�|jd||j�|jd|j�|jd|j�|jd|j�|jt	tdd�|S)Nr9r
Znone�-)�namer>Zwrap�width�vbar)rhr<)�side�fill�hbar)rhr4ZyscrollcommandZxscrollcommandr:ZCommandZControlz
<%s-minus>z<%s-underscore>z
<%s-equal>z	<%s-plus>z<Control-MouseWheel>z<Control-Button-4>z<Control-Button-5>r	)rkrl�expand)ZFrame�
text_frameZTextr9rZ	ScrollbarrjZyviewZpackZLEFT�YrLrmZxviewZBOTTOM�X�set�tuple�txtfontrZbind_all�
decrease_size�
increase_size�bind�update_mousewheelZBOTH)r_r@ror9rjrmZshortcutr#r#r$rN�s.



zDemoWindow.makeTextFramecCs�|tj_d|_d|_tj|dd|j|j�tj_|_}|j�|jj	d|j
�d|jd<tj�|_}tj
j||j�|j|_|gtj_|S)Ni�i iXz<Configure>rr0)rAZ_ScreenrBrcrdZScrolledCanvasrbZ
adjustScrollsZ_rootwindowrwrfZScreen�screen�TurtleScreenra�scanvasZ	RawTurtleZscreens)r_r@ZcanvasZ_s_r#r#r$rO�s 

zDemoWindow.makeGraphFramecCs(|td<tt�|jd<d||jd<dS)Nr	r:zFont size %dr9)rtrsr9rP)r_�sizer#r#r$�set_txtsize�szDemoWindow.set_txtsizecCs|jttddt��dS)Nr	�break)r}�maxrt�MINIMUM_FONT_SIZE)r_�dummyr#r#r$ru�szDemoWindow.decrease_sizecCs|jttddt��dS)Nr	r~)r}�minrt�MAXIMUM_FONT_SIZE)r_r�r#r#r$rvszDemoWindow.increase_sizecCs$|jdktkr|j�S|j�SdS)Nr)Zdeltarrurv)r_rer#r#r$rxszDemoWindow.update_mousewheel��bluecCsh|jj||tkrdndd�|jj||tkr0dndd�|jj||tkrLdndd�|jj||d�dS)Nz#d00z#fca)r^r5)r9r;)rS�config�NORMALrUrWrP)r_�start�stop�clearZtxtZcolorr#r#r$r[szDemoWindow.configGUIcs>t|�}x0t�D]&}|f�fdd�	}|j|dt|d�qW|S)Ncs�j|�dS)N)rZ)r")r_r#r$�loadsz)DemoWindow.makeLoadDemoMenu.<locals>.loadr)r2r3r:r<)rHr)�add_command�menufont)r_�masterr1r"r�r#)r_r$rIszDemoWindow.makeLoadDemoMenucslt|�}|jd�jtd�|jd�jtd�|j�x2tD]*}|f�fdd�	}|jt|�dt|d�q:W|S)NzDecrease (C-'-'))r2r<r:zIncrease (C-'+')cs�j|�dS)N)r})r|)r_r#r$�resize(sz'DemoWindow.makeFontMenu.<locals>.resizer)r2r3r:r<)rHr�rur�rvZ
add_separator�
font_sizes�str)r_r�r1r|r�r#)r_r$rJs


zDemoWindow.makeFontMenucs@t|�}x2tD]*\}}||f�fdd�	}|j|t|d�qW|S)Ncst�j||�dS)N)rr@)�
help_label�	help_file)r_r#r$�show2sz%DemoWindow.makeHelpMenu.<locals>.show)r2r:r<)rH�help_entriesr�r�)r_r�r1r�r�r�r#)r_r$rK.s
zDemoWindow.makeHelpMenucCs|jr|jj�d|_dS)NF)rXryr�)r_r#r#r$�
refreshCanvas7s
zDemoWindow.refreshCanvasc
Cs�|j�dtj_d|}t|�tj||_t|jj	d��}|j
�}WdQRX|jjdd�|jj
d|�|jj|d�|jtttdd�t|_dS)	NFzturtledemo.�rz1.0�endz# - a Python turtle graphics examplezPress start button�red)rVrArz�_RUNNING�
__import__�sys�modules�module�open�__file__�readr9�delete�insertr@rCr[r�r\�READYr^)r_r`�modname�f�charsr#r#r$rZ<s
zDemoWindow.loadfilecCs�|j�d|_dtj_|jtttdd�|jj	�|jj
d�t|_y$|j
j�}|dkr`t|_nt|_Wn.tjk
r�|jdkr�dSt|_d}YnX|jtkr�|jttt|�n"|jtkr�d|_|jtttdd�dS)	NTzdemo running...r?ZstandardZ	EVENTLOOPzstopped!zuse mouse/keys or STOPr�)r�rXrArzr�r[r\r�ryr��mode�RUNNINGr^r��main�EVENTDRIVEN�DONEZ
Terminatorr@rY)r_�resultr#r#r$rRKs2









zDemoWindow.startDemocCs4|j�|jjd�|jjdd�|jttt�dS)N�allr�)Zcursor)r�ryZ_deleter{r�r[r�r\)r_r#r#r$rVhszDemoWindow.clearCanvascCs2|jr&|j�d|_|jtttdd�dtj_dS)NFzSTOPPED!r�)rYrVr[r�r\rArzr�)r_r#r#r$rTns
zDemoWindow.stopItcCsdtj_|jj�d|_dS)NF)rArzr�r@Zdestroy)r_r#r#r$rDvs
zDemoWindow._destroy)N)N)N)r�r�)�__name__�
__module__�__qualname__rarfrNrOr}rurvrxr[rIrJrKr�rZrRrVrTrDr#r#r#r$r*s$
D


	
	r*cCst�}|jj�dS)N)r*r@Zmainloop)Zdemor#r#r$r�|sr��__main__)rrr)'r�r&ZtkinterZidlelib.colorizerrrZidlelib.percolatorrZidlelib.textviewrZ
turtledemorZabout_turtledemorA�path�dirname�abspathr�r(�platformrr]r�r�r�r�r�r�rQrtr�r�r�r)r��objectr*r�r�r#r#r#r$�<module>Ws:


~


Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists