3 § 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.Údarwinéé Z64Z32rNl)ÚsysÚplatformÚmaxsizer©rrú7/opt/alt/python36/lib64/python3.6/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ôtj||ƒ|jdd�|jd|jƒd|jƒ|s6dndfƒd|_d|_|jƒ|j ddd �|j |p€d t ƒ›d t ƒ›d �ƒ|j |ƒ|jƒ|jd |jƒ||_|jjƒ|jd|jƒ|jd|jƒd|_||_|sð|jƒ|jƒ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} t || t|j |j d �} | j ddtd!ddd"�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+dtd!ddd"�t |d,tƒ|j |j d-�} | j d.dtddd�t |d/||j |j d-�}|j d.d)tddd�t||j d �}|j dddtd0�t|d1d+|j |jd2�|_ |j jtddd3�t|d4d+|j |j!d2�|_"|j"jtddd3�t|d5d+|j |j#d2�|_$|j$jtddd3�t|d)td|j d*�j d6dtd!ddd"�t |d7tƒ|j |j d-�}|j d8dtddd�t||j d �}|j d9dd!td0�t|d:d+|j |j%d2�|_&|j&jtddd3�t|d;d+|j |j'd2�|_(|j(jtddd3�t|d5d+|j |j)d2�|_*|j*jtddd3�dS)?Nr)r!Úrelief)ÚsideÚfillT)r1Úexpandr2ZClose)ÚtextÚcommandr )ÚpadxÚpady)r')r3r2ZIDLEÚcourieréÚbold)r4r(r'Zfontré )ÚrowÚcolumnÚstickyr6r7ÚinfoZ patchlevelz8.6z.pngz.gifZIconsZidle_48)ZmasterÚfile)Zimager')r<r=r>Zrowspanr6r7z8Python's Integrated Development and Learning EnvironmentÚ )r4Zjustifyr(r'é)r<r=r>Ú columnspanr6r7zemail: idle-dev@python.orgé)r<r=rCr>r6r7zhttps://docs.python.org/z/library/idle.htmléé)r!r0r$r'ézPython version: )r4r(r'é z Tk version: )r<r=rCr>ZLicense)r4r%Zhighlightbackgroundr5)r1r6r7Z CopyrightZCreditsé zIDLE version: é é ZREADMEZNEWS)r8r9r:z z=Python's Integrated Development and Learning Environment )+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|jdtƒdS)zHandle License button event.zAbout - LicenseN)Údisplay_printer_textÚlicense)r/rrrrR’szAboutDialog.show_py_licensecCs|jdtƒdS)zHandle Copyright button event.zAbout - CopyrightN)rZÚ copyright)r/rrrrS–szAboutDialog.show_py_copyrightcCs|jdtƒdS)z#Handle Python Credits button event.zAbout - Python CreditsN)rZÚcredits)r/rrrrTšszAboutDialog.show_py_creditscCs|jdddƒdS)z!Handle Idle Credits button event.zAbout - Creditsz CREDITS.txtzutf-8N)Údisplay_file_text)r/rrrrW szAboutDialog.show_idle_creditscCs|jdddƒdS)zHandle Readme button event.zAbout - Readmez README.txtÚasciiN)r^)r/rrrrU¤szAboutDialog.show_readmecCs|jdddƒdS)zHandle News button event.z About - NEWSzNEWS.txtzutf-8N)r^)r/rrrrV¨szAboutDialog.show_idle_newscCs.|jƒdj|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. rA)rN)Ú_Printer__setuprNÚ_Printer__linesrZ view_textrr.)r/r*Zprinterr4rrrrZ¬s z AboutDialog.display_printer_textcCs:tjjtjjtjjtƒƒ|ƒ}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) rLrMrNrOrPrQrZ view_filerr.)r/r*ÚfilenameÚencodingÚfnrrrr^¹szAboutDialog.display_file_textcCs|jƒ|jƒdS)zDismiss help_about dialog.N)Z grab_releaseZdestroy)r/Zeventrrrr+ÄszAboutDialog.ok)N)N)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__r&r)rRrSrTrWrUrVrZr^r+rrrrrs"V rÚ__main__)Úmainz!idlelib.idle_test.test_help_aboutrF)Ú verbosityÚexit)Úrun)rhrLrrrrZtkinterrrrrrr r r r r rrrrrZidlelibrrrreZunittestrjZidlelib.idle_test.htestrmrrrrÚs0 5