Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/root/sys/lib/python2.7/idlelib/configDialog.pyo

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�`^c@s�dZddlTddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZdd
lmZdefd��YZed
kr�dlmZee�ndS(s�IDLE Configuration Dialog: support user customization of IDLE by GUI

Customize font faces, sizes, and colorization attributes.  Set indentation
defaults.  Customize keybindings.  Colorization and keybindings can be
saved as user defined sets.  Select startup options including shell/editor
and default window size.  Define additional help sources.

Note that tab width in IDLE is currently fixed at eight due to Tk issues.
Refer to comments in EditorWindow autoindent code for details.

i�(t*N(tidleConf(t
DynOptionMenu(t
TabbedPageSet(t
GetKeysDialog(tGetCfgSectionNameDialog(tGetHelpSourceDialog(t
macosxSupporttConfigDialogcBs�eZed�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d �Z#d!�Z$d"�Z%d#�Z&d$�Z'd%�Z(d&�Z)d'�Z*d(�Z+d)�Z,d*�Z-d+�Z.d,�Z/dHd-�Z1d.�Z2d/�Z3d0�Z4d1�Z5d2�Z6d3�Z7d4�Z8d5�Z9d6�Z:d7�Z;d8�Z<d9�Z=d:�Z>d;�Z?d<�Z@d=�ZAd>�ZBd?�ZCd@�ZDdA�ZEdB�ZFdC�ZGdD�ZHdE�ZIdF�ZJdG�ZKRS(IcCsztj||�|j�|jdd�|jd�|rIi|_n|jd|j�d|j�|stdndf�i
d3d
6d4d
6d5d6d6d6d7d6d8d6d9d6d:d6d;d"6d<d%6d=d(6d>d+6d?d.6|_	|j
�|j�|jd/t
d0t
�|j|�|j�|jd1|j�||_|jj�|j�|j�|j�|j�d2S(@sG
        _htest - bool, change box location when running htest
        tborderwidthisIDLE Preferencess+%d+%diii�tnormalt00sNormal Texttkeywordt01sPython Keywordst
definitiont02sPython Definitionstbuiltint03sPython Builtinstcommentt04sPython Commentststringt05sPython Stringsthilitet06s
Selected Textthitt07s
Found Texttcursort08tCursorterrort09s
Error Texttconsolet10sShell Normal Texttstdoutt11sShell Stdout Texttstderrt12sShell Stderr TexttheighttwidthtWM_DELETE_WINDOWN(R
R(RR
(RR(RR(RR(sstringR(RR(RR(scursorR(serrorR(RR (sstdoutR"(sstderrR$(tToplevelt__init__twm_withdrawt	configurettitlet
instance_dicttgeometrytwinfo_rootxtwinfo_rootyt
themeElementstResetChangedItemst
CreateWidgetst	resizabletFALSEt	transienttgrab_settprotocoltCanceltparentttabPagest	focus_settLoadConfigstAttachVarCallbackstwm_deiconifytwait_window(tselfR:R,t_htest((s*/sys/lib/python2.7/idlelib/configDialog.pyR)sB

!





	



c	Cs�t|dddddg�|_t|dd�}tj�rHi}nidd	6d
d6}t|ddd
|jdt|�|_t|ddd
|j	dt|�|_
t|ddd
|jdt|�|_|j
�|j�|j�|j�|jjdtd	d�|j
jdtd	d�|jjdtd	d�|jdt�t|dddd�jdt�|jjdtdtdt�dS(Nt
page_namess
Fonts/TabstHighlightingtKeystGeneraltpadyiitpadxittexttOktcommandt	takefocustApplyR9tsideiR%R	itexpandtfill(RR;tFrameRtisAquaTktButtonRJR5tbuttonOkRMtbuttonApplyR9tbuttonCanceltCreatePageFontTabtCreatePageHighlighttCreatePageKeystCreatePageGeneraltpacktLEFTtBOTTOMtTOPtTRUEtBOTH(RAtframeActionButtonstpaddingArgs((s*/sys/lib/python2.7/idlelib/configDialog.pyR3Js2		



"c
Cs�t|�|_t|�|_t|�|_t|�|_tj|d+�|_	|j
jdj}t
|dddtdd	�}t
|dddtdd
�}t|�}t|�}t|dtdd�}t|d
ddtdt�|_|jjd|j�t|�}|jd|jj�|jjd|j�t|dd�}t||jdd|j�|_t|d|jddddddd|j�}	t|dt dd�}
t|
dddtd|j	�|_!t|�}t|dtdd�}t"|d|jddd dd!dd"d#�|_#|j$d$td%dd&dd't%d(t&�|j$d$td%dd&dd(t'�|j$d$t(d%dd&dd(t)�|j$d$t(d%dd&dd(t)�|j$d$t(d)t*�|jj$d$td't%d(t)�|j$d$td(t'�|j$d$td)t*�|jj$d$td)t*�|	j$d$td)t*d%d*�|
j$d$t(d%dd&dd't%d(t&�|j!j$d't%d(t&�|j$d$t(d(t)�|j$d$t(d)t*d%d�|j#j$d$t(d%dd(t)�|S(,Ntcourieri
R
s
Fonts/TabsR	itreliefRIs Base Editor Font s Indentation Width tjustifysFont Face :R%iRLtexportselections<ButtonRelease-1>RKtyscrollcommandsSize :tvariabletonvalueitoffvalueitBolds,AaBbCcDdEe
FfGgHhIiJjK
1234567890
#:+=(){}[]tfontsPython Standard: 4 Spaces!torientt
horizontalttickintervaltfrom_ttoiRNRHRGRORPtanchori(Rci
snormal(+t	StringVartfontSizet
BooleanVartfontBoldtfontNametIntVartspaceNumttkFonttFontteditFontR;tpagestframet
LabelFrametGROOVERQtLabelR\tListboxR5tlistFontNametbindtOnListFontButtonReleaset	ScrollbartconfigtyviewtsetRtNonet
SetFontSampletoptMenuFontSizetCheckbuttontSOLIDtlabelFontSampletScalet
scaleSpaceNumR[R_R`tYR^tXtW(
RAR~t	frameFonttframeIndentt
frameFontNametframeFontParamtlabelFontNameTitlet
scrollFonttlabelFontSizeTitlet
checkFontBoldtframeFontSampletframeIndentSizetlabelSpaceNumTitle((s*/sys/lib/python2.7/idlelib/configDialog.pyRWosf					("""(c Cst|�|_t|�|_t|�|_t|�|_t|�|_t|�|_t|�|_|j	j
dj}t|dddt
dd�}t|dddt
dd�}t|dtddd	dWd
ddddddtdddt�	|_|j}|jdd��|jdd��dXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvf}x)|D]!}|jt|d|d�q�Wx;|jj�D]*}|j|j|dd?|d@��q�W|jdAt�t|dtdd�|_t|�}t|jddBdC|jdd�}	t|j|jddd�|_!t"|dD|jdEdddFdC|j#�|_$t"|dD|jdEdddGdC|j#�|_%|jj&d�t|ddHdC|j'�}
t(|ddI�}t"|dD|jdEddC|j)ddJ�|_*t"|dD|jdEddC|j)ddK�|_+t||jddCd�|_,t||jddCd�|_-t|ddLdC|j.�|_/|j0dMt1dNdOdPdOdQt2dRt3�|j0dMt1dNdOdPdOdRt4�|jj0dMt5dNdOdPdOdQt2dRt6�|j0dMt5dNdOdPd�|jj0dMt5dNdOdPdOdQt2dRt3�|	j0dMt5dQt2dRt6dNdSdPdT�|j!j0dMt5dQt2dRt6dNdSdPdU�|j$j0dMt1dVt7�|j%j0dMt8dVt9�|
j0dMt:dRt6dNdOdPdO�|j0dMt5dVt9dNdOdPdO�|j*j0dMt5dVt9dNdO�|j+j0dMt5dVt9dNdOdPd�|j,j0dMt5dRt6dNdOdPdO�|j-j0dMt5dRt6dVt9dNdOdPdO�|j/j0dMt5dRt6dNdOdPdO�|S(wNRDR	iRdRIs Custom Highlighting s Highlighting Theme iRlRcitRthand2R&iR%iRLthighlightthicknessitwraps<Double-Button-1>cSsdS(Ntbreak((te((s*/sys/lib/python2.7/idlelib/configDialog.pyt<lambda>�ss<B1-Motion>cSsdS(NR�((R�((s*/sys/lib/python2.7/idlelib/configDialog.pyR��ss#you can click hereRs
R
s#to choose itemstdefRt tfuncRs(param):s
  s"""string"""Rs

  var0 = s'string's

  var1 = s
'selected'Rs

  var2 = s'found'Rs

  var3 = tlistRt(R�s)

s error Rscursor |s
 tshellRR!R#s<ButtonPress-1>cSs|jj�jj|�S(N(twidgettwinfo_toplevelthighlightTargetR�(teventtelem((s*/sys/lib/python2.7/idlelib/configDialog.pyR��ststatesChoose Colour for :RKRhtvaluet
Foregroundt
BackgroundsSave as New Custom Themes	Select : sa Built-in Themesa Custom ThemesDelete Custom ThemeRNRHiRGRORPiiiRr(scourieriR�(s#you can click herescomment(s
snormal(s#to choose itemsscomment(s
snormal(R�skeyword(R�snormal(sfuncs
definition(s(param):snormal(s
  snormal(s"""string"""sstring(s

  var0 = snormal(s'string'sstring(s

  var1 = snormal(s
'selected'shilite(s

  var2 = snormal(s'found'shit(s

  var3 = snormal(slistsbuiltin(R�snormal(sNonesbuiltin(s)

snormal(s error serror(R�snormal(scursor |R(s
 snormal(sshellsconsole(R�snormal(sstdoutsstdout(R�snormal(sstderrsstderr(s
snormal(;RstbuiltinThemetcustomThemeRutfgHilitetcolourRwtthemeIsBuiltinR�R;R}R~RR�tTextR�R5tNONEttextHighlightSampleR�tinserttENDR1tkeysttag_bindR�tDISABLEDRQtframeColourSetRSt	GetColourRR�toptMenuHighlightTargettRadiobuttontSetColourSampleBindingtradioFgtradioBgR�tSaveAsNewThemeR�tSetThemeTypetradioThemeBuiltintradioThemeCustomtoptMenuThemeBuiltintoptMenuThemeCustomtDeleteCustomThemetbuttonDeleteCustomThemeR[R\R_R`R�R^R�tEtRIGHTR�R](RAR~tframeCustomt
frameThemeRIttextAndTagsttxTatelementt	frameFgBgtbuttonSetColourtbuttonSaveCustomThemetlabelTypeTitle((s*/sys/lib/python2.7/idlelib/configDialog.pyRX�s�									
		("+$(+""%%+%cCs�t|�|_t|�|_t|�|_t|�|_t|�|_|jjdj	}t
|dddtdd�}t
|dddtdd�}t|�}t
|dd�}t|�}t|d	t�}t|d
tdt�|_|jjd|j�|jd
|jj�|jd
|jj�|jjd|j�|jjd|j�t|ddd
|jdt�|_gtd�D]$}t|dddddd�^q�}	t|	dd|jddd
|jdd�|_ t|	dd|jddd
|jdd�|_!t"|	d|jdd
d�|_$t"|	d|jdd
d�|_%t|	dddd
|j&�|_'t|	dddd
|j(�}
|j)dt*dddddt+dt,�|j)dt*dddddt,�|jj)dt*dt-dddd�|j)dt.dddddt+dt,�|j/dd d�|j0dd d�|j1d!dd"dd#dd$t2�|jj1d!dd"dd$t3�|j1d!dd"dd$t4�|j1d!dd"dd$t5�|j j1d!dd"dd$t2t4�|j!j1d!dd"dd$t2t4�|j$j1d!dd"dd$t3�|j%j1d!dd"dd$t3�|j'j)dt.dt-dt6dd�|
j)dt.dt-dt6dd�|	dj)dt7dt,dt6�|	dj)dt7dt-dt6dd�|S(%NRER	iRdRIs Custom Key Bindings s	 Key Set sAction - Key(s)RmRLRfs<ButtonRelease-1>RKRgtxscrollcommandsGet New Keys for SelectionR�RHRGiRhR�isUse a Built-in Key SetsUse a Custom Key SetsDelete Custom Key SetsSave as New Custom Key SetRNiRORPtweighttrowtcolumnt
columnspantsticky(8Rst
bindingTargettbuiltinKeyst
customKeysRutkeysAreBuiltint
keyBindingR;R}R~RR�RQR�R�t
HORIZONTALR�R5tlistBindingsR�tKeyBindingSelectedR�R�txviewR�RSt
GetNewKeysR�t
buttonNewKeystrangeR�tSetKeysTypetradioKeysBuiltintradioKeysCustomRR�toptMenuKeysBuiltintoptMenuKeysCustomtDeleteCustomKeystbuttonDeleteCustomKeystSaveAsNewKeySetR[R]R_R`R�R\tcolumnconfiguretrowconfiguretgridR�tNSEWtNStEWtTrueR^(RAR~R�tframeKeySetstframeTargettlabelTargetTitlet
scrollTargetYt
scrollTargetXtitframestbuttonSaveCustomKeys((s*/sys/lib/python2.7/idlelib/configDialog.pyRYsp		4


("%("##%" &cCs�t|�|_t|�|_t|�|_t|�|_t|�|_t|�|_t|�|_	t|�|_
|jjdj
}t|dddtdd�}t|dddtdd�}t|dddt�}t|dddt�}t|dddt�}t|dddtdd�}t|dd	�}t|d
|jddd
|jdd�}	t|d
|jddd
|jdd�}
t|dd�}t|d
|jddd
|jdd�}t|d
|jddd
|jdd�}
t|ddd�}t|dd�}t|d|jdd�}t|dd�}t|d|jdd�}t|ddd�}t|d|jdd�}t|dd�}t|d
|jdddd�}t|d
|jdd dd!�}t|d
|jdd"dd#�}t|�}t|�}t|�}t|d$d%d&td't�|_|jd
|jj�|jjd(|j�|jjd)|j�t|dd*d+tdd,d
|j �|_!t|dd-dd,d
|j"�|_#t|dd.d+tdd,d
|j$�|_%|j&d/t'd0d%d1d%d2t(�|j&d/t'd0d%d1d%d2t(�|j&d/t'd0d%d1d%d2t(�|j&d/t'd0d%d1d%d2t(�|j&d/t'd0d%d1d%d2t(�|j&d/t'd0d%d1d%d3t)d2t*�|j&d/t+d4t,d0d%d1d%�|
j&d/t-d4t,d0d%d1d%�|	j&d/t-d4t,d0d%d1d%�|j&d/t+d4t,d0d%d1d%�|
j&d/t-d4t,d0d%d1d%�|j&d/t-d4t,d0d%d1d%�|j&d/t+d4t,d0d%d1d%�|j&d/t-d4t.d0d5d1d%�|j&d/t-d4t.d1d%�|j&d/t-d4t.d0d5d1d%�|j&d/t-d4t.d1d%�|j&d/t+d4t,d0d%d1d%�|j&d/t-d4t.d0d5d1d%�|j&d/t+d4t,d0d%d1d%�|j&d/t-d4t.d1d%�|j&d/t-d4t.d1d%�|j&d/t-d4t.d1d%�|j&d/t-d0d%d1d%d2t/�|j&d/t'd0d%d1d%d3t)d2t*�|j&d/t-d4t,d2t/�|jj&d/t+d4t.d3t)d2t*�|j!j&d/t'd4t,d1d%�|j#j&d/t'd4t,�|j%j&d/t'd4t,d1d%�|S(6NRFR	iRdRIs Startup Preferences s Autosave Preferences s Additional Help Sources s
At StartupRhR�iRKsOpen Edit WindowisOpen Shell WindowsAt Start of Run (F5)  sPrompt to Saves	No PromptsInitial Window Sizes  (in characters)tWidthttextvariableR&itHeightsParagraph reformats width (in characters)sDefault Source EncodingtlocalesLocale-definedsutf-8sUTF-8tnoneR�R%iRLRfRgs<ButtonRelease-1>tEditR�itAddtRemoveRNRHRGRPRORri
(0RstwinWidtht	winHeightt	paraWidthRxtstartupEdittautoSavetencodingRutuserHelpBrowserthelpBrowserR;R}R~RR�RQR�R�R�tEntryR�R�R5tlistHelpR�R�R�R�tHelpSourceSelectedRSR�tHelpListItemEdittbuttonHelpListEdittHelpListItemAddtbuttonHelpListAddtHelpListItemRemovetbuttonHelpListRemoveR[R^R�R_R`R\R�R�R�R�(RAR~tframeRunt	frameSavetframeWinSizet
frameParaSizet
frameEncodingt	frameHelptlabelRunChoiceTitletradioStartupEdittradioStartupShelltlabelRunSaveTitletradioSaveAskt
radioSaveAutotlabelWinSizeTitletlabelWinWidthTitlet
entryWinWidthtlabelWinHeightTitletentryWinHeighttlabelParaWidthTitletentryParaWidthtlabelEncodingTitletradioEncLocaletradioEncUTF8tradioEncNonet
frameHelpListtframeHelpListButtonstscrollHelpList((s*/sys/lib/python2.7/idlelib/configDialog.pyRZLs�			
		
	"""""("""""""""""""(%cCs�|jjd|j�|jjd|j�|jjd|j�|jjd|j�|j	jd|j
�|jjd|j�|j
jd|j�|jjd|j�|jjd|j�|jjd|j�|jjd|j�|jjd|j�|jjd|j�|jjd|j�|jjd|j�|jjd|j �|j!jd|j"�|j#jd|j$�|j%jd|j&�dS(Ntw('Rtttrace_variabletVarChanged_fontSizeRwtVarChanged_fontNameRvtVarChanged_fontBoldRytVarChanged_spaceNumR�tVarChanged_colourR�tVarChanged_builtinThemeR�tVarChanged_customThemeR�tVarChanged_themeIsBuiltinR�tVarChanged_highlightTargetR�tVarChanged_keyBindingR�tVarChanged_builtinKeysR�tVarChanged_customKeysR�tVarChanged_keysAreBuiltinRtVarChanged_winWidthRtVarChanged_winHeightRtVarChanged_paraWidthRtVarChanged_startupEditRtVarChanged_autoSaveRtVarChanged_encoding(RA((s*/sys/lib/python2.7/idlelib/configDialog.pyR>�s&cGs)|jj�}|jddd|�dS(NtmaintEditorWindows	font-size(RttgettAddChangedItem(RAtparamsR�((s*/sys/lib/python2.7/idlelib/configDialog.pyR;�scGs)|jj�}|jddd|�dS(NRNRORl(RwRPRQ(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyR<�scGs)|jj�}|jddd|�dS(NRNROs	font-bold(RvRPRQ(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyR=�scGs)|jj�}|jddd|�dS(NRNtIndents
num-spaces(RyRPRQ(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyR>�scGs|j�dS(N(tOnNewColourSet(RARR((s*/sys/lib/python2.7/idlelib/configDialog.pyR?�scGs3|jj�}|jddd|�|j�dS(NRNtThemetname(R�RPRQtPaintThemeSample(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyR@�scGsB|jj�}|dkr>|jddd|�|j�ndS(Ns- no custom themes -RNRURV(R�RPRQRW(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyRA�scGsF|jj�}|jddd|�|r8|j�n
|j�dS(NRNRUtdefault(R�RPRQR@RA(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyRB�s

cGs|j�dS(N(tSetHighlightTarget(RARR((s*/sys/lib/python2.7/idlelib/configDialog.pyRC�scGs�|jj�}|jj�}|jjt�j�d}tj|�rb|jd|||�n/tj	|�}|d}|jd|||�dS(NiR�t_cfgBindingst
extensions(
R�RPR�R�tANCHORtsplitRt
IsCoreBindingRQtGetExtnNameForEvent(RARRR�tkeySetR�textNametextKeybindSection((s*/sys/lib/python2.7/idlelib/configDialog.pyRD�s
cGs6|jj�}|jddd|�|j|�dS(NRNRERV(R�RPRQtLoadKeysList(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyREscGsE|jj�}|dkrA|jddd|�|j|�ndS(Ns- no custom keys -RNRERV(R�RPRQRc(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyRFscGsF|jj�}|jddd|�|r8|j�n
|j�dS(NRNRERX(R�RPRQRERF(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyRGs

cGs)|jj�}|jddd|�dS(NRNROR&(RRPRQ(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyRHscGs)|jj�}|jddd|�dS(NRNROR%(RRPRQ(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyRIscGs)|jj�}|jddd|�dS(NRNtFormatParagrapht	paragraph(RRPRQ(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyRJ!scGs)|jj�}|jddd|�dS(NRNRFseditor-on-startup(RRPRQ(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyRK%scGs)|jj�}|jddd|�dS(NRNRFtautosave(RRPRQ(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyRL)scGs)|jj�}|jddd|�dS(NRNROR(RRPRQ(RARRR�((s*/sys/lib/python2.7/idlelib/configDialog.pyRM-scCs)iid6id6id6id6|_dS(NRNt	highlightR�R[(tchangedItems(RA((s*/sys/lib/python2.7/idlelib/configDialog.pyR21scCsLt|�}||j|kr3i|j||<n||j|||<dS(N(tstrRh(RAttypetsectiontitemR�((s*/sys/lib/python2.7/idlelib/configDialog.pyRQ9scCs�iid6id6id6id6}x�|j�D]�}tjd|�}xh|D]`}i|||<tj|j|�}x3|D]+}tj|j||�||||<qWqNWq/W|S(NRNRgR�R[RX(R�RtGetSectionListt
defaultCfgt
GetOptionListtGet(RAtdItemst
configTypetsectionsRktoptionstoption((s*/sys/lib/python2.7/idlelib/configDialog.pytGetDefaultItems?s"

1cCs�|jj�rK|jjdt�|jjdt�|jjdt�nL|jjdt�|jjdt�|jjdt�|jjdt�dS(NR�(	R�RPR�R�tNORMALR�R�R�R�(RA((s*/sys/lib/python2.7/idlelib/configDialog.pyR�KscCs�|jj�rK|jjdt�|jjdt�|jjdt�nL|jjdt�|jjdt�|jjdt�|jjdt�dS(NR�(	R�RPR�R�RwR�R�R�R�(RA((s*/sys/lib/python2.7/idlelib/configDialog.pyR�VscCs�|jjt�}|jj|�}|j�d}|jj�rU|jj�}n|jj�}tj	�}||j
dj�kr�|j
d|}x+|j�D]}||j�||<q�Wn|j�}t
|d||�j}	|	r�|jj�rTdd}
|j|
�}|sD|jj|�|jj|�dS|j|�n|jj|�|jj||d|	�|jj|�|jj|�|jj|	�n |jj|�|jj|�dS(NiR�sGet New Keyss4Your changes will be saved as a new Custom Key Set. s/Enter a name for your new Custom Key Set below.s - (R�tindexR\RPR]R�R�R�RtGetCurrentKeySetRhR�tvaluesRtresulttGetNewKeysNamet
select_sett
select_anchortCreateNewKeySettdeleteR�R�R�(RAt	listIndextbindingtbindNametcurrentKeySetNametcurrentBindingst
keySetChangesR�tcurrentKeySequencestnewKeystmessaget	newKeySet((s*/sys/lib/python2.7/idlelib/configDialog.pyR�as>cCs>tjdd�tjdd�}t|d||�j}|S(NtuserR�RXsNew Custom Key Set(RRmRR{(RAR�t	usedNamesR�((s*/sys/lib/python2.7/idlelib/configDialog.pyR|�s
	cCs)|jd�}|r%|j|�ndS(NsNew Key Set Name:(R|R(RAtnewKeysName((s*/sys/lib/python2.7/idlelib/configDialog.pyR��scCs|jjdt�dS(NR�(R�R�Rw(RAR�((s*/sys/lib/python2.7/idlelib/configDialog.pyR��sc
Cs5|jj�r!|jj�}n|jj�}tj|�}i}x>|j�D]0}|dd!}tj||�}|||<qRW||j	dj�kr�|j	d|}x%|j�D]}||||<q�Wn|j
||�tjdd�}	|	j�|j
j|	|�|jjd�|j�dS(Nii�R�R�i(R�RPR�R�RtGetCoreKeysR�RtjoinRht
SaveNewKeySetRmtsortR�tSetMenuR�R�(
RAt
newKeySetNametprevKeySetNametprevKeysR�R�t	eventNameR�R�t
customKeyList((s*/sys/lib/python2.7/idlelib/configDialog.pyR�s&

c	CsHd}d}|jj�r6d}|jjt�}ntj|�}|j�}|j�|jjdt	�x�|D]�}t
j||�}|dd!}||jdj�kr�|jd|j�kr�jd||}q�|jj
t	|d|�quW|rD|jj|�|jj|�|jj|�ndS(Niiii�R�s - (R�tcurselectionRxR\Rt	GetKeySetR�R�R�R�RR�RhR�tseeR}R~(	RAt
keySetNametreselectR�R�R`t	bindNamesR�tkey((s*/sys/lib/python2.7/idlelib/configDialog.pyRc�s(


cCs<|jj�}tjddd|d|�s3dStjdj|�||jdkrk|jd|=ntjdj�tj	dd�}|j
�|s�|jjdt
�|jj|d�n|jj||d	�|jjtjd
jdd��|jjtjd
jdd
��|j�|j�dS(NsDelete Key SetsAre you sure you wish sto delete the key set %r ?R:R�R�R�s- no custom keys -iRNRERXRV(R�RPttkMessageBoxtaskyesnoRtuserCfgtremove_sectionRhtSaveRmR�R�R�R�R�R�R�R�RnRpR�RMR�(RAR�titemList((s*/sys/lib/python2.7/idlelib/configDialog.pyR��s&	
##
cCs?|jj�}tjddd|fd|�s6dStjdj|�||jdkrn|jd|=ntjdj�tj	dd�}|j
�|s�|jjdt
�|jj|d�n|jj||d	�|jjtjd
jdd��|jjtjd
jdd
��|j�|j�dS(NsDelete ThemesAre you sure you wish sto delete the theme %r ?R:RgR�R�s- no custom themes -iRNRURXRV(R�RPR�R�RR�R�RhR�RmR�R�R�R�R�R�R�R�RnRpR�RMR�(RAt	themeNameR�((s*/sys/lib/python2.7/idlelib/configDialog.pyR��s&	
##
cCs�|jj�}|jjd�}tjd|dd|d|�\}}|r�||kr�|jj�r�dd}|j|�}|s�dS|j|�|j	j
|�q�|j	j
|�ndS(NtbgR:R,sPick new colour for : tinitialcolors2Your changes will be saved as a new Custom Theme. s-Enter a name for your new Custom Theme below.(R�RPR�tcgetttkColorChoosertaskcolorR�tGetNewThemeNametCreateNewThemeR�R�(RAttargett
prevColourt	rgbTuplettcolourStringR�tnewTheme((s*/sys/lib/python2.7/idlelib/configDialog.pyR��s
cCs�|jj�}|jjd|�|jj�r:d}nd}|j|jj�d}|jj|i||6�|j	j�}|d|}|j
d|||�dS(NR�t
foregroundt
backgroundit-Rg(R�RPR�R�R�R1R�R�t
tag_configR�RQ(RAt	newColourtplanet
sampleElementtthemetthemeElement((s*/sys/lib/python2.7/idlelib/configDialog.pyRTs	cCs>tjdd�tjdd�}t|d||�j}|S(NR�RgRXsNew Custom Theme(RRmRR{(RAR�R�R�((s*/sys/lib/python2.7/idlelib/configDialog.pyR�s
	cCs)|jd�}|r%|j|�ndS(NsNew Theme Name:(R�R�(RAtnewThemeName((s*/sys/lib/python2.7/idlelib/configDialog.pyR�!scCs�|jj�r'd}|jj�}nd}|jj�}tj||�}||jdj�kr�|jd|}x%|j�D]}||||<q�Wn|j||�tj	dd�}|j
�|jj||�|jj
d�|j�dS(NRXR�Rgi(R�RPR�R�RtGetThemeDictRhR�tSaveNewThemeRmR�R�R�R�R�(RAR�t	themeTypeR�R�tthemeChangesR�tcustomThemeList((s*/sys/lib/python2.7/idlelib/configDialog.pyR�&s 
cCs6|jjt�}|jj|j��|j�dS(N(R�RPR\RwR�tlowerR�(RAR�Rl((s*/sys/lib/python2.7/idlelib/configDialog.pyR�>scCsu|jj�}|jj�r*tj}n	tj}||jj�|f}|jjd|�|j	j
d|�dS(NRl(RwRPRvRztBOLDRwRtR�R�R�R+(RAR�Rwt
fontWeighttnewFont((s*/sys/lib/python2.7/idlelib/configDialog.pyR�Cs	cCs�|jj�dkrN|jjdt�|jjdt�|jjd�n6|jjdt�|jjdt�|jjd�|j	�dS(NRR�i(
R�RPR�R�R�R�R�R�RwtSetColourSample(RA((s*/sys/lib/python2.7/idlelib/configDialog.pyRYMscGs|j�dS(N(R�(RAtargs((s*/sys/lib/python2.7/idlelib/configDialog.pyR�XscCsd|j|jj�d}|jj�r2d}nd}|jj||�}|jjd|�dS(NiR�R�R�(R1R�RPR�R�ttag_cgetR�R�(RAttagR�R�((s*/sys/lib/python2.7/idlelib/configDialog.pyR�[s	cCs0|jj�r!|jj�}n|jj�}x�jj�D]�}|j|d}tj||�}|dkr�tj|ddd�|d<n||jdj�kr|jd|}|d|kr�|d|d	<n|d
|kr||d
|d<qn|j	j
||�q@W|j�dS(NiRR
tfgBgR�R�Rgs-foregroundR�s-background(R�RPR�R�R1R�RtGetHighlightRhR�R�R�(RAR�telementTitleR�tcolourst	themeDict((s*/sys/lib/python2.7/idlelib/configDialog.pyRWcs"	cCs|j�dS(N(tSetHelpListButtonStates(RAR�((s*/sys/lib/python2.7/idlelib/configDialog.pyRxscCs�|jj�dkr>|jjdt�|jjdt�n^|jj�rv|jjdt�|jjdt�n&|jjdt�|jjdt�dS(NiR�(RtsizeRR�R�RR�Rw(RA((s*/sys/lib/python2.7/idlelib/configDialog.pyR�{scCsht|d�j}|rZ|jj|d|df�|jjt|d�|j�n|j�dS(NsNew Help Sourceii(	RR{tuserHelpListtappendRR�R�tUpdateUserHelpChangedItemsR�(RAt
helpSource((s*/sys/lib/python2.7/idlelib/configDialog.pyR�s
cCs�|jjt�}|j|}t|dd|dd|d�j}|sX||kr\dS||j|<|jj|�|jj||d�|j�|j	�dS(NsEdit Help SourcetmenuItemitfilePathi(
RRxR\R�RR{R�R�R�R�(RAt	itemIndexR�t
newHelpSource((s*/sys/lib/python2.7/idlelib/configDialog.pyR�s


cCsD|jjt�}|j|=|jj|�|j�|j�dS(N(RRxR\R�R�R�R�(RAR�((s*/sys/lib/python2.7/idlelib/configDialog.pyR�s


c	Cssi|jdd<x[tdt|j�d�D]=}|jddt|�tj|j|dd d��q.WdS(s<Clear and rebuild the HelpFiles section in self.changedItemsRNt	HelpFilesiit;N(RhR�tlenR�RQRiRR�(RAtnum((s*/sys/lib/python2.7/idlelib/configDialog.pyR��s#c	
CsTttj|��}|j�x!|D]}|jjt|�q&Wtjddddd�}|j	�}|j
j|�g|D]}|j	�^q�}||kr�j|�}|jj
|�|jj|�|jj|�ntjddddddd	�}|jjd|�|jjtjddddddd��|j�dS(NRNRORlRXRcs	font-sizeRjtintR t7t8t9R"R$t13t14t16t18t20t22s	font-bolditbool(R�R�R�s10s11s12R�R�R�R�R�R�(R�RztfamiliesR�R�R�R�Rt	GetOptionR�RwR�RxR�R}R~R�R�RvR�(	RAtfontsRltconfiguredFonttlc_configuredFonttstlc_fontstcurrentFontIndexRt((s*/sys/lib/python2.7/idlelib/configDialog.pytLoadFontCfg�s*

		
cCs5tjddddddd�}|jj|�dS(NRNRSs
num-spacesRXiRjR�(RR�RyR�(RARy((s*/sys/lib/python2.7/idlelib/configDialog.pyt
LoadTabCfg�sc	s��jjtjddddddd��tj�}�jj�r�tjdd�}|j��jj	||�tjdd�}|j�|s��j
jd	t��j
jd
�q9�jj	||d�nbtjdd�}|j��jj	||�tjdd�}|j��jj	||d��j��jj�}|jd�fd
���jj	||d��j��j�dS(NRNRURXRjR�iRgR�R�s- no custom themes -iR�cs�j|dS(Ni(R1(tx(RA(s*/sys/lib/python2.7/idlelib/configDialog.pyR��s(R�R�RR�tCurrentThemeRPRmR�R�R�R�R�R�R�R�R�R1R�R�RWRY(RAt
currentOptionR�t
themeNames((RAs*/sys/lib/python2.7/idlelib/configDialog.pytLoadThemeCfg�s2





c	Cs`|jjtjddddddd��tj�}|jj�r�tjdd�}|j�|jj	||�tjdd�}|j�|s�|j
jd	t�|j
jd
�q9|jj	||d�nbtjdd�}|j�|jj	||�tjdd�}|j�|jj	||d�|j�tj�}|j|�dS(NRNRERXRjR�iR�R�R�s- no custom keys -i(R�R�RR�tCurrentKeysRPRmR�R�R�R�R�R�R�R�R�Rc(RAR�R�R�((s*/sys/lib/python2.7/idlelib/configDialog.pyt
LoadKeyCfg�s,




c	Cs2|jjtjddddddd��|jjtjddddd	dd��|jjtjdd
ddd��|jjtjdd
d
dd��|jjtjddddd��|jjtjdd
ddd��tj	�|_
x(|j
D]}|jjt
|d	�qW|j�dS(NRNRFseditor-on-startupRXiRjR�RfiROR&R�R%RdReRR
(RR�RR�RRRRRtGetAllExtraHelpSourcesListR�RR�R�R�(RAthelpItem((s*/sys/lib/python2.7/idlelib/configDialog.pytLoadGeneralCfg
s 


cCs6|j�|j�|j�|j�|j�dS(s�
        load configuration from default and user config files and populate
        the widgets on the config dialog pages.
        N(R�R�R�R�R�(RA((s*/sys/lib/python2.7/idlelib/configDialog.pyR="s




cCsltjdj|�s-tjdj|�nx8|j�D]*}||}tjdj|||�q:WdS(s�
        save a newly created core key set.
        keySetName - string, the name of the new key set
        keySet - dictionary containing the new key set
        R�N(RR�thas_sectiontadd_sectionR�t	SetOption(RAR�R`R�R�((s*/sys/lib/python2.7/idlelib/configDialog.pyR�1s

cCsltjdj|�s-tjdj|�nx8|j�D]*}||}tjdj|||�q:WdS(s�
        save a newly created theme.
        themeName - string, the name of the new theme
        theme - dictionary containing the new theme
        RgN(RR�R�R�R�R�(RAR�R�R�R�((s*/sys/lib/python2.7/idlelib/configDialog.pyR�=s

cCsltj|j||�rRtj|j||�|krRtj|j||�Sntj|j|||�S(N(RRnt
has_optionRpR�tRemoveOptionR�(RARrRkRlR�((s*/sys/lib/python2.7/idlelib/configDialog.pytSetUserValueIscCs tjdj�x�|jj�D]�}t}x�|j|j�D]�}|dkrptjdjd�t}nxU|j||j�D]<}|j|||}|j||||�r�t}q�q�WqAW|r!tj|j�q!q!Wx%ddgD]}tj|j�q�j	�dS(s3Save configuration changes to the user config file.RNR�R�RgN(
RR�R�RhR�tFalseR�R�RR2(RARrtcfgTypeHasChangesRkRlR�((s*/sys/lib/python2.7/idlelib/configDialog.pytSaveAllChangedConfigsQs 	cCs1|jjj�}x|D]}|j�qWdS(N(R:R-R�tRemoveKeybindings(RAtwinInstancestinstance((s*/sys/lib/python2.7/idlelib/configDialog.pytDeactivateCurrentConfigfs
cCsY|jjj�}x@|D]8}|j�|j�|j�|j�|j�qWdS(s'Dynamically apply configuration changesN(R:R-R�tResetColorizert	ResetFonttset_notabs_indentwidthtApplyKeybindingstreset_help_menu_entries(RARR((s*/sys/lib/python2.7/idlelib/configDialog.pytActivateConfigChangesms




cCs|j�dS(N(tdestroy(RA((s*/sys/lib/python2.7/idlelib/configDialog.pyR9wscCs|j�|j�dS(N(RMR(RA((s*/sys/lib/python2.7/idlelib/configDialog.pyRJzs
cCs"|j�|j�|j�dS(N(RRR
(RA((s*/sys/lib/python2.7/idlelib/configDialog.pyRM~s

cCsdS(N((RA((s*/sys/lib/python2.7/idlelib/configDialog.pytHelp�sN(Lt__name__t
__module__RR)R3RWRXRYRZR>R;R<R=R>R?R@RARBRCRDRERFRGRHRIRJRKRLRMR2RQRvR�R�R�R|R�R�RRcR�R�R�RTR�R�R�R�R�R�RYR�R�RWRR�RRRR�R�R�R�R�R�R=R�R�RRRR
R9RJRMR(((s*/sys/lib/python2.7/idlelib/configDialog.pyRs�0	%	?	Y	E	p																										$													
								
					!									
			t__main__(trun(t__doc__tTkinterR�R�RzRtidlelib.configHandlerRtidlelib.dynOptionMenuWidgetRtidlelib.tabbedpagesRtidlelib.keybindingDialogRtidlelib.configSectionNameDialogRtidlelib.configHelpSourceEditRtidlelibRR(RRtidlelib.idle_test.htestR(((s*/sys/lib/python2.7/idlelib/configDialog.pyt<module>s$
$��r

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].