a  ze#@sdZddlZddlZddlmZmZddlmZmZm Z m Z m Z ddlm Z m Z mZmZmZmZmZmZmZmZddlmZeZddZGd d d eZed krdd lmZed dddddlmZeedS)zAbout Dialog for IDLE N)python_version architecture)ToplevelFrameLabelButton PhotoImage) SUNKENTOPBOTTOMLEFTXBOTHWEWNSEWE)textviewcCs2tjdkrtjdkrdSdStdddSdS)zReturn bits for platform.darwinlZ64Z32rN)sysplatformmaxsizerrrF/opt/bitninja-python-dojo/embedded/lib/python3.9/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 | |p~d 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+%ddz#bbbbbbz#000000F)heightwidthz About IDLE z (z bit)ZWM_DELETE_WINDOWzzN)r__init__Z configureZgeometryZ winfo_rootxZ winfo_rootybgfgcreate_widgetsZ resizabletitleversionrZ transientZgrab_setprotocolokparent button_okZ focus_setbind_current_textviewrZ deiconifyZ wait_window)selfr-r)rrrrrr%s2     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#tdtd$d%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 |j d0|_!|j!jtddd1t|d2d)|j |j"d0|_#|j#jtddd1t|d3d)|j |j$d0|_%|j%jtddd1t|d'td|j d(j d4dtddddt |d5t|j |j d+}|j d6dtdddt||j d }|j d7ddtd.t|d8d)|j |j&d0|_'|j'jtddd1t|d9d)|j |j(d0|_)|j)jtddd1t|d3d)|j |j*d0|_+|j+jtddd1dS):Nr)r relief)sidefillT)r3expandr4Close)textcommandr)padxpady)r&)r5r4ZIDLE)ZcourierZbold)r7r'r&Zfontr )rowcolumnstickyr9r:infoZ patchlevelz8.6z.pngz.gifZIconsZidle_48)Zmasterfile)Zimager&)r=r>r?Zrowspanr9r:z=Python's Integrated Development and Learning Environment )r7Zjustifyr'r&)r=r>r? columnspanr9r:zemail: idle-dev@python.org)r=r>rCr?r9r:zhttps://docs.python.org/.z/library/idle.html)r r2r#r&zPython version: )r7r'r& z Tk version: )r=r>rCr?ZLicense)r7r$Zhighlightbackgroundr8)r3r9r:Z CopyrightZCredits zIDLE version: ZREADMEZNEWS),rr packr r r rrr,r.r&rr'ZgridrZtkcallospathjoinabspathdirname__file__r_rootZ icon_imagerr r*rindexrrshow_py_licenseZ py_licenseshow_py_copyrightZ py_copyrightshow_py_creditsZ py_credits show_readmeZreadmeshow_idle_newsZ idle_newsshow_idle_creditsZ idle_credits)r1frameZ frame_buttonsZframe_backgroundheaderZ tk_patchlevelextZiconZlogoZ byline_textZbylineZemailZdocsZpyverZtkverZ py_buttonsZidleverZ idle_buttonsrrrr(>s     zAboutDialog.create_widgetscCs|dtdS)zHandle License button event.zAbout - LicenseN)display_printer_textlicenser1rrrrWszAboutDialog.show_py_licensecCs|dtdS)zHandle Copyright button event.zAbout - CopyrightN)r` copyrightrbrrrrXszAboutDialog.show_py_copyrightcCs|dtdS)z#Handle Python Credits button event.zAbout - Python CreditsN)r`creditsrbrrrrYszAboutDialog.show_py_creditscCs|ddddS)z!Handle Idle Credits button event.zAbout - Creditsz CREDITS.txtutf-8Ndisplay_file_textrbrrrr\szAboutDialog.show_idle_creditscCs|ddddS)zHandle Readme button event.zAbout - Readmez README.txtasciiNrfrbrrrrZszAboutDialog.show_readmecCs|ddddS)zHandle News button event.z About - NEWSzNEWS.txtreNrfrbrrrr[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__setuprQ_Printer__linesrZ view_textrr0)r1r)Zprinterr7rrrr`s   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) rOrPrQrRrSrTrZ view_filerr0)r1r)filenameencodingfnrrrrgs zAboutDialog.display_file_textcCs||dS)zDismiss help_about dialog.N)Z grab_releaseZdestroy)r1eventrrrr,szAboutDialog.ok)N)N)N)__name__ __module__ __qualname____doc__r%r(rWrXrYr\rZr[r`rgr,rrrrrs"V r__main__)mainz!idlelib.idle_test.test_help_aboutrF) verbosityexit)run) rtrOrrrrtkinterrrrrrr r r r r rrrrrZidlelibrr*rrrqZunittestrvZidlelib.idle_test.htestryrrrrs0 5