B /g^#c@sdZddlZddlZddlmZmZddlmZmZm Z m Z m Z ddlm Z m Z mZmZmZmZmZmZmZmZddlmZddZGd d d eZed krdd lmZed dddddlmZeedS)zAbout Dialog for IDLE N)python_version architecture)ToplevelFrameLabelButton PhotoImage) SUNKENTOPBOTTOMLEFTXBOTHWEWNSEWE)textviewcCs2tjdkrtjdkrdSdStdddSdS)zReturn bits for platform.ZdarwinlZ64Z32rN)sysplatformZmaxsizerrr*/usr/lib64/python3.7/idlelib/help_about.py build_bitss rc@sveZdZdZddddddZddZd d Zd d Zd dZddZ ddZ ddZ ddZ dddZ dddZdS) AboutDialogz!Modal about dialog for idle NF)_htest_utestcCst|||jdd|d|d||s6dndfd|_d|_||j ddd | |pd t d t d | |||d |j||_|j|d|j|d|jd|_||_|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+%diidz#bbbbbbz#000000F)heightwidthz About IDLE z (z bit)ZWM_DELETE_WINDOWzzN)r__init__Z configureZgeometryZ winfo_rootxZ winfo_rootybgfgcreate_widgetsZ resizabletitlerrZ transientZgrab_setZprotocolokparent button_okZ focus_setZbind_current_textviewrZ deiconifyZ wait_window)selfr&r$rrrrrr s.     zAboutDialog.__init__cCst|dtd}t|}|jttd|jtdtdt|d|jd|_ |j jddd t||j d }|jdtd t |d |j |j d d}|j ddtddd|jdd}|dkrdnd}tjtjtjtdd|}t||d|_t ||j|j d}|j ddtddddd} t || t|j |j d} | j ddtddddt |d t|j |j d} | j d!ddtddd"t |d#tddd$t|j |j d} | j d%ddtddd"t|d&td|j d'j d(dtddddt |d)t|j |j d*} | j d+dtdddt |d,||j |j d*}|j d+d&tdddt||j d }|j dddtd-t|d.d(|j |jd/|_ |j jtddd0t|d1d(|j |j!d/|_"|j"jtddd0t|d2d(|j |j#d/|_$|j$jtddd0t|d&td|j d'j d3dtddddt |d4t|j |j d*}|j d5dtdddt||j d }|j d6ddtd-t|d7d(|j |j%d/|_&|j&jtddd0t|d8d(|j |j'd/|_(|j(jtddd0t|d2d(|j |j)d/|_*|j*jtddd0dS)9Nr)rrelief)sidefillT)r+expandr,ZClose)textcommandr)padxpady)r!)r-r,ZIDLE)ZcourieriZbold)r.r"r!Zfontri )rowcolumnstickyr0r1ZinfoZ patchlevelz8.6z.pngz.gifZIconsZidle_48)ZmasterZfile)Zimager!)r2r3r4Zrowspanr0r1z=Python's Integrated Development and Learning Environment )r.Zjustifyr"r!i)r2r3r4 columnspanr0r1zemail: idle-dev@python.orgi)r2r3r5r4r0r1zhttps://docs.python.org/z/library/idle.htmlii)rr*rr!izPython version: )r.r"r!i z Tk version: )r2r3r5r4ZLicense)r.rZhighlightbackgroundr/)r+r0r1Z CopyrightZCreditsi zIDLE version: i i ZREADMEZNEWS)+rrZpackr r r r rr%r'r!rr"ZgridrZtkZcallospathjoinabspathdirname__file__rZ_rootZ icon_imagerr rrrshow_py_licenseZ py_licenseshow_py_copyrightZ py_copyrightshow_py_creditsZ py_credits show_readmeZreadmeshow_idle_newsZ idle_newsshow_idle_creditsZ idle_credits)r)ZframeZ frame_buttonsZframe_backgroundZheaderZ tk_patchlevelZextZiconZlogoZ byline_textZbylineZemailZdocsZpyverZtkverZ py_buttonsZidleverZ idle_buttonsrrrr#<s            zAboutDialog.create_widgetscC|dtdS)zHandle License button event.zAbout - LicenseN)display_printer_textZlicenser)rrrr<zAboutDialog.show_py_licensecCrB)zHandle Copyright button event.zAbout - CopyrightN)rCZ copyrightrDrrrr=rEzAboutDialog.show_py_copyrightcCrB)z#Handle Python Credits button event.zAbout - Python CreditsN)rCZcreditsrDrrrr>rEzAboutDialog.show_py_creditscC|ddddS)z!Handle Idle Credits button event.zAbout - Creditsz CREDITS.txtutf-8Ndisplay_file_textrDrrrrArEzAboutDialog.show_idle_creditscCrF)zHandle Readme button event.zAbout - Readmez README.txtZasciiNrHrDrrrr?rEzAboutDialog.show_readmecCrF)zHandle News button event.z About - NEWSzNEWS.txtrGNrHrDrrrr@rEzAboutDialog.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. Z rN)Z_Printer__setupr8Z_Printer__linesrZ view_textrr()r)r$Zprinterr.rrrrCs z AboutDialog.display_printer_textcCs:tjtjtjt|}tj|||||jd|_ dS)zCreate 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. rJN) r6r7r8r9r:r;rZ view_filerr()r)r$ZfilenameZencodingZfnrrrrIszAboutDialog.display_file_textcCs||dS)zDismiss help_about dialog.N)Z grab_releaseZdestroy)r)Zeventrrrr%szAboutDialog.okNrKrK)__name__Z __module__Z __qualname____doc__r r#r<r=r>rAr?r@rCrIr%rrrrrs"V rZ__main__)mainz!idlelib.idle_test.test_help_aboutrF)Z verbosityZexit)run)rMr6rrrrZtkinterrrrrrrr r r r r rrrrZidlelibrrrrLZunittestrNZidlelib.idle_test.htestrOrrrrZs0 5