B „ f#ã@sÎdZddlZddlZddlmZmZddlmZmZm Z m Z m Z ddlm Z m Z mZmZmZmZmZmZmZmZddlmZdd„ZGd d „d eƒZed krÊdd lmZed ddd�ddlmZeeƒdS)zAbout Dialog for IDLE éN)Úpython_versionÚ architecture)ÚToplevelÚFrameÚLabelÚButtonÚ PhotoImage) ÚSUNKENÚTOPÚBOTTOMÚLEFTÚXÚBOTHÚWÚEWÚNSEWÚE)ÚtextviewcCs2tjdkrtjdkrdSdStƒddd…SdS)zReturn bits for platform.ÚdarwinlZ64Z32rNé)ÚsysÚplatformÚmaxsizer©rrú7/opt/alt/python37/lib64/python3.7/idlelib/help_about.pyÚ build_bitss rc@sveZdZdZddddœdd„Zdd„Zd d „Zd d „Zd d„Zdd„Z dd„Z dd„Z dd„Z ddd„Z ddd„ZdS)Ú AboutDialogz!Modal about dialog for idle NF)Ú_htestÚ_utestcCsôt ||¡|jdd�| d| ¡d| ¡|s6dndf¡d|_d|_| ¡|j ddd �|  |p€d t ƒ›d t ƒ›d �¡|  |¡| ¡| d |j¡||_|j ¡| d|j¡| d|j¡d|_||_|sð| ¡| ¡dS)aCreate popup, do not return until tk widget destroyed. parent - parent of this dialog title - string which is title of popup dialog _htest - bool, change box location when running htest _utest - bool, don't wait_window when running unittest é)Ú borderwidthz+%d+%déédz#bbbbbbz#000000F)ÚheightÚwidthz About IDLE z (z bit)ZWM_DELETE_WINDOWzzN)rÚ__init__Z configureZgeometryZ winfo_rootxZ winfo_rootyÚbgÚfgÚcreate_widgetsZ resizableÚtitlerrZ transientZgrab_setZprotocolÚokÚparentÚ button_okZ focus_setZbindÚ_current_textviewrZ deiconifyZ wait_window)Úselfr+r)rrrrrr%s.     zAboutDialog.__init__cCsÈt|dtd�}t|ƒ}|jttd�|jtdtd�t|d|jd�|_ |j jddd �t||j d �}|jdtd �t |d |j |j d d�}|j ddtddd�|j dd¡}|dkr¶dnd}tj tj tj t¡¡dd|›�¡}t| ¡|d�|_t ||j|j d�}|j ddtdddd�d} t || t|j |j d�} | j ddtdddd�t |d t|j |j d�} | j d!ddtddd"�t |d#tƒdd…d$t|j |j d�} | j d%ddtddd"�t|d&td|j d'�j d(dtdddd�t |d)tƒ|j |j d*�} | j d+dtddd�t |d,||j |j d*�}|j d+d&tddd�t||j d �}|j dddtd-�t|d.d(|j |jd/�|_ |j jtddd0�t|d1d(|j |j!d/�|_"|j"jtddd0�t|d2d(|j |j#d/�|_$|j$jtddd0�t|d&td|j d'�j d3dtdddd�t |d4tƒ|j |j d*�}|j d5dtddd�t||j d �}|j d6ddtd-�t|d7d(|j |j%d/�|_&|j&jtddd0�t|d8d(|j |j'd/�|_(|j(jtddd0�t|d2d(|j |j)d/�|_*|j*jtddd0�dS)9Nr)r Úrelief)ÚsideÚfillT)r0Úexpandr1ZClose)ÚtextÚcommandr)ÚpadxÚpady)r&)r2r1ZIDLE)ZcourieréZbold)r3r'r&Zfontré )ÚrowÚcolumnÚstickyr5r6ÚinfoZ patchlevelz8.6z.pngz.gifZIconsZidle_48)ZmasterÚfile)Zimager&)r9r:r;Zrowspanr5r6z=Python's Integrated Development and Learning Environment )r3Zjustifyr'r&é)r9r:r;Ú columnspanr5r6zemail: idle-dev@python.orgé)r9r:r?r;r5r6zhttps://docs.python.org/z/library/idle.htmléé)r r/r#r&ézPython version: )r3r'r&é z Tk version: )r9r:r?r;ZLicense)r3r$Zhighlightbackgroundr4)r0r5r6Z CopyrightZCreditsé zIDLE version: é é ZREADMEZNEWS)+rr Zpackr r r rrr*r,r&rr'ZgridrZtkZcallÚosÚpathÚjoinÚabspathÚdirnameÚ__file__rZ_rootZ icon_imagerr rrrÚshow_py_licenseZ py_licenseÚshow_py_copyrightZ py_copyrightÚshow_py_creditsZ py_creditsÚ show_readmeZreadmeÚshow_idle_newsZ idle_newsÚshow_idle_creditsZ idle_credits)r.ÚframeZ frame_buttonsZframe_backgroundÚheaderZ tk_patchlevelZextZiconZlogoZ byline_textZbylineZemailZdocsZpyverZtkverZ py_buttonsZidleverZ idle_buttonsrrrr(<s–            zAboutDialog.create_widgetscCs| dt¡dS)zHandle License button event.zAbout - LicenseN)Údisplay_printer_textÚlicense)r.rrrrN’szAboutDialog.show_py_licensecCs| dt¡dS)zHandle Copyright button event.zAbout - CopyrightN)rVÚ copyright)r.rrrrO–szAboutDialog.show_py_copyrightcCs| dt¡dS)z#Handle Python Credits button event.zAbout - Python CreditsN)rVÚcredits)r.rrrrPšszAboutDialog.show_py_creditscCs| ddd¡dS)z!Handle Idle Credits button event.zAbout - Creditsz CREDITS.txtzutf-8N)Údisplay_file_text)r.rrrrS szAboutDialog.show_idle_creditscCs| ddd¡dS)zHandle Readme button event.zAbout - Readmez README.txtÚasciiN)rZ)r.rrrrQ¤szAboutDialog.show_readmecCs| ddd¡dS)zHandle News button event.z About - NEWSzNEWS.txtzutf-8N)rZ)r.rrrrR¨szAboutDialog.show_idle_newscCs.| ¡d |j¡}tj||||jd�|_dS)a Create textview for built-in constants. Built-in constants have type _sitebuiltins._Printer. The text is extracted from the built-in and then sent to a text viewer with self as the parent and title as the title of the popup. Ú )rN)Ú_Printer__setuprJÚ_Printer__linesrZ view_textrr-)r.r)Zprinterr3rrrrV¬s z AboutDialog.display_printer_textcCs:tj tj tj t¡¡|¡}tj|||||jd�|_ dS)zæCreate textview for filename. The filename needs to be in the current directory. The path is sent to a text viewer with self as the parent, title as the title of the popup, and the file encoding. )rN) rHrIrJrKrLrMrZ view_filerr-)r.r)ÚfilenameÚencodingÚfnrrrrZ¹szAboutDialog.display_file_textcCs| ¡| ¡dS)zDismiss help_about dialog.N)Z grab_releaseZdestroy)r.Zeventrrrr*ÄszAboutDialog.ok)N)N)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__r%r(rNrOrPrSrQrRrVrZr*rrrrrs"V rÚ__main__)Úmainz!idlelib.idle_test.test_help_aboutrF)Ú verbosityÚexit)Úrun)rerHrrrrZtkinterrrrrrr r r r r rrrrrZidlelibrrrrbZunittestrgZidlelib.idle_test.htestrjrrrrÚs0 5