<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>

Yf                 @   s   d  Z  d d l Z d d l Z d d l Td d l j Z d d l j Z	 Gd d   d e
  Z e d k r d d l Z e j d d d	 d
 d d d l m Z e e  d S)zKDialog to specify or edit the parameters for a user configured help source.    N)*c               @   ss   e  Z d  Z d d d d d  Z d d   Z d d   Z d	 d
   Z d d   Z d d d  Z d d d  Z	 d S)GetHelpSourceDialog Fc             C   sO  t  j |  |  |  j d d  |  j d t d t  |  j |  |  j |  |  j   |  j d |  j	  | |  _
 d |  _ |  j   |  j j |  |  j j |  |  j   |  j   |  j d | j   | j   d |  j   d | j   | s| j   d |  j   d n d	 f  |  j   |  j d
 |  j  |  j   d S)a2  Get menu entry and url/ local file location for Additional Help

        User selects a name for the Help resource and provides a web url
        or a local file as its source.  The user can enter a url or browse
        for the file.

        _htest - bool, change box location when running htest
        borderwidth   ZheightwidthZWM_DELETE_WINDOWNz+%d+%d      z<Return>)Toplevel__init__Z	configureZ	resizableZFALSEtitleZ	transientZgrab_setZprotocolcancelparentresultcreate_widgetsmenusetpathZwithdrawZupdate_idletasksZgeometryZwinfo_rootxZwinfo_widthZwinfo_reqwidthZwinfo_rootyZwinfo_heightZwinfo_reqheightZ	deiconifyZbindokZwait_window)selfr   r   ZmenuItemZfilePathZ_htest r   A/opt/alt/python35/lib64/python3.5/idlelib/configHelpSourceEdit.pyr      s.    	
		


		0
zGetHelpSourceDialog.__init__c          
   C   sm  t  |   |  _ t  |   |  _ t  |   |  _ t |  d d d t |  _ |  j j d t d t	 d t
  t |  j d t d t d	 d
 } t |  j d |  j d d |  _ |  j j   t |  j d t d t d	 d } t |  j d |  j d d |  _ |  j j   | j d t d d d d  |  j j d t d d d d  | j d t d d d d  |  j j d t d d d d  t |  j d	 d d d d |  j } | j d d  t |   } | j d t d t  t | d	 d d d d t d |  j |  _ |  j j d d d d d d d d  t | d	 d d d d |  j |  _ |  j j d d d d d d d d  d  S)Nr   r   ZreliefZsideexpandZfillZanchorZjustifytextz
Menu Item:Ztextvariabler      z,Help File Path: Enter URL or browse for file(   Zpadxr   Zpady   ZBrowse   ZcommandZOKdefaultrowr   columnZCancel   )Z	StringVarr   r   ZfontSizeZFrameZGROOVEZ	frameMainZpackZTOPZTRUEZBOTHZLabelWZLEFTZEntry	entryMenu	focus_set	entryPathZButtonbrowse_fileZBOTTOMXZACTIVEr   ZbuttonOkZgridr   ZbuttonCancel)r   Z	labelMenuZ	labelPathZbrowseButtonZframeButtonsr   r   r   r   /   s<    		%z"GetHelpSourceDialog.create_widgetsc             C   s   d d d d d g } |  j  j   } | rE t j  j |  \ } } np d  } t j d  d  d k r t j  j t j  j t j  d  } t j  j	 |  s t j
   } n t j
   } t j d |  d |  } | j d | d |  } | r |  j  j |  d  S)N
HTML Files*.htm *.htmlTEXT	PDF Files*.pdfWindows Help Files*.chm
Text Files*.txt	All Filesr   r   winZDocr   	filetypesZ
initialdirZinitialfile)r(   r)   r*   )r+   r,   r*   )r-   r.   )r/   r0   r*   )r1   r   )r   getossplitsysplatformjoindirname
executableisdirgetcwdtkFileDialogZOpenZshowr   )r   r3   r   dirbaseZ
opendialogfiler   r   r   r&   O   s$    	$zGetHelpSourceDialog.browse_filec             C   s   d } |  j  j   } | j   | sW t j d d d d d |   |  j j   d } nA t |  d k r t j d d d d	 d |   |  j j   d } | S)
z3Simple validity check for a sensible menu item nameTr   zMenu Item ErrormessagezNo menu item specifiedr   Fr   z(Menu item too long:
Limit 30 characters.)r   r4   striptkMessageBox	showerrorr#   r$   len)r   menu_okr   r   r   r   rG   f   s     
	zGetHelpSourceDialog.menu_okc             C   s   d } |  j  j   } | j   | sW t j d d d d d |   |  j j   d } ny | j d  ri ng | d
 d  d k r | d d
  } t j  j	 |  s t j d d d d d |   |  j j   d } | S)z(Simple validity check for menu file pathTr   zFile Path ErrorrB   zNo help file path specified.r   Fwww.httpNr   zfile:zHelp file path does not exist.)rH   rI   )
r   r4   rC   rD   rE   r%   r$   
startswithr5   exists)r   path_okr   r   r   r   rL   z   s(    
	zGetHelpSourceDialog.path_okNc             C   s   |  j    r |  j   r |  j j   j   |  j j   j   f |  _ t j d k r |  j d } | j	 d  rs n# t
 |  j  |  _ d | |  j d <|  j   d  S)	Ndarwinr!   wwwfile:http:https:zfile://)rN   rO   rP   rQ   )rG   rL   r   r4   rC   r   r   r7   r8   rJ   listdestroy)r   eventr   r   r   r   r      s    zGetHelpSourceDialog.okc             C   s   d  |  _  |  j   d  S)N)r   rS   )r   rT   r   r   r   r      s    	zGetHelpSourceDialog.cancel)
__name__
__module____qualname__r   r   r&   rG   rL   r   r   r   r   r   r   r   
   s   $ r   __main__z"idlelib.idle_test.test_config_help	verbosityr   exitF)run)__doc__r5   r7   ZtkinterZtkinter.messageboxZ
messageboxrD   Ztkinter.filedialogZ
filedialogr>   r
   r   rU   ZunittestmainZidlelib.idle_test.htestr[   r   r   r   r   <module>   s   
