kWc@sTdZddlTddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZdd lmZddl m Z dd lmZd efd YZd efdYZdZdefdYZedkrPddlZejddddeddlmZeeendS(sIDLE 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 ConfigDialogcBseZdeedZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!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.Z0dJd/Z2d0Z3d1Z4d2Z5d3Z6d4Z7d5Z8d6Z9d7Z:d8Z;d9Z<d:Z=d;Z>d<Z?d=Z@d>ZAd?ZBd@ZCdAZDdBZEdCZFdDZGdEZHdFZIdGZJdHZKdIZLRS(KtcCstj||||_|r+i|_n|j|jdd|j|pTd|jd|jd|j |sdndfi d3d 6d4d 6d5d6d6d6d7d6d8d6d9d6d:d6d;d"6d<d%6d=d(6d>d+6d?d.6|_ |j |j |j d/td0t|j||j|jd1|j|jj|j|j|s|j|jnd2S(@s _htest - bool, change box location when running htest _utest - bool, don't wait_window when running unittest t borderwidthisIDLE Preferencess+%d+%diiitnormalt00s Normal 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(R R!(sstdoutR#(sstderrR%(tToplevelt__init__tparentt instance_dictt wm_withdrawt configurettitletgeometryt winfo_rootxt winfo_rootyt themeElementstResetChangedItemst CreateWidgetst resizabletFALSEt transienttgrab_settprotocoltCancelttabPagest focus_sett LoadConfigstAttachVarCallbackst wm_deiconifyt wait_window(tselfR+R/t_htestt_utest((s*/usr/lib/python2.7/idlelib/configDialog.pyR*sH   !         cCst|dddddg|_|jjdtdtdt|j|j|j|j |j jdt dS( Nt page_namess Fonts/Tabst HighlightingtKeystGeneraltsidetexpandtfill( RR<tpacktTOPtTRUEtBOTHtCreatePageFontTabtCreatePageHighlighttCreatePageKeystCreatePageGeneraltcreate_action_buttonstBOTTOM(RB((s*/usr/lib/python2.7/idlelib/configDialog.pyR5Ms     c CsCtjri}nidd6dd6}t|dd}t|dd}t|ddd|jd t||_t|dd d|jd t||_t|dd d|j d t||_ |jj d t dd |jj d t dd |j j d t dd t|ddddj d t |j d t|S(NitpadxitpadyittexttOktcommandt takefocustApplyR;RIiR&R i(RtisAquaTktFrametButtonRYR7tbuttonOkR\t buttonApplyR;t buttonCancelRLtLEFTRMRU(RBt paddingArgstoutertbuttons((s*/usr/lib/python2.7/idlelib/configDialog.pyRTVs(  "c Cs|j}t||_t||_t||_t||_tj |d+|_ |j j dj }t|dddtdd }t|dddtdd }t|}t|}t|d tdd }t|d ddtdt|_|jjd|jt|}|jd|jj|jjd|jt|dd} t||jdd|j|_t |d|jddddddd|j} t|dt!dd} t| d td|j dd|_"t|} t| d tdd} 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 itreliefRXs Base Editor Font s Indentation Width tjustifys Font Face :R&iR[texportselectionsRZtyscrollcommandsSize :tvariabletonvalueitoffvalueitBoldtfonts,AaBbCcDdEe FfGgHhIiJjK 1234567890 #:+=(){}[]sPython Standard: 4 Spaces!torientt horizontalt tickintervaltfrom_ttoiRIRVRWRJRKtanchori(Rgi snormal(,R+t StringVartfontSizet BooleanVartfontBoldtfontNametIntVartspaceNumttkFonttFontteditFontR<tpagestframet LabelFrametGROOVER^tLabelRctListboxR7t listFontNametbindtOnListFontButtonReleaset ScrollbartconfigtyviewtsetRtNonet SetFontSampletoptMenuFontSizet CheckbuttontSOLIDtlabelFontSampletScalet scaleSpaceNumRLRNROtYRMtXtW(RBR+Rt frameFontt frameIndentt frameFontNametframeFontParamtlabelFontNameTitlet scrollFonttlabelFontSizeTitlet checkFontBoldtframeFontSampletframeIndentSizetlabelSpaceNumTitle((s*/usr/lib/python2.7/idlelib/configDialog.pyRPusn          ("""(cCs|j}t||_t||_t||_t||_t||_t||_t||_ |j j dj }t |dddtdd}t |dddtdd}t|dtddd dVd ddddddtdddt |_|j}|jdd|jdddWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtf}x)|D]!}|jt|d|dqWx;|jD]0}|d>} |j|j|dd?| qW|jd@tt|dtdd|_t|} t|jddAdB|jdd} t|j|j ddd|_!t"| dC|jdDdddEdB|j#|_$t"| dC|jdDdddFdB|j#|_%|jj&dt|ddGdB|j'} t(|ddH} t"|dC|jdDddB|j)ddI|_*t"|dC|jdDddB|j)ddJ|_+t||jddBd|_,t||jddBd|_-t|ddKdB|j.|_/|j0dLt1dMdNdOdNdPt2dQt3|j0dLt1dMdNdOdNdQt4|jj0dLt5dMdNdOdNdPt2dQt6| j0dLt5dMdNdOd|jj0dLt5dMdNdOdNdPt2dQt3| j0dLt5dPt2dQt6dMdRdOdS|j!j0dLt5dPt2dQt6dMdRdOdT|j$j0dLt1dUt7|j%j0dLt8dUt9| j0dLt:dQt6dMdNdOdN| j0dLt5dUt9dMdNdOdN|j*j0dLt5dUt9dMdN|j+j0dLt5dUt9dMdNdOd|j,j0dLt5dQt6dMdNdOdN|j-j0dLt5dQt6dUt9dMdNdOdN|j/j0dLt5dQt6dMdNdOdN|S(uNRFR iRhRXs Custom Highlighting s Highlighting Theme iRpRgi R Rthand2R'iR&i R[thighlightthicknessitwrapscSsdS(Ntbreak((te((s*/usr/lib/python2.7/idlelib/configDialog.pytss cSsdS(NR((R((s*/usr/lib/python2.7/idlelib/configDialog.pyRss#you can click hereRs R s#to choose itemstdefR t tfuncRs (param): s """string"""Rs var0 = s'string's var1 = s 'selected'Rs var2 = s'found'Rs var3 = tlistRt(Rs) s error Rscursor |s tshellR R"R$cSs|jjjj|dS(N(twidgettwinfo_toplevelthighlightTargetR(teventtelem((s*/usr/lib/python2.7/idlelib/configDialog.pyttemsststatesChoose Colour for :RZRltvaluet Foregroundt BackgroundsSave as New Custom Themes Select : sa Built-in Themesa Custom ThemesDelete Custom ThemeRIRViRWRJRKiiiRv(scourieri R (s#you can click herescomment(s snormal(s#to choose itemsscomment(s snormal(Rskeyword(Rsnormal(sfuncs definition(s (param): 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(Rsnormal(sNonesbuiltin(s) snormal(s error serror(Rsnormal(scursor |R(s snormal(sshellsconsole(Rsnormal(sstdoutsstdout(Rsnormal(sstderrsstderr(s snormal(;R+Rwt builtinThemet customThemeRytfgHilitetcolourR{tthemeIsBuiltinRR<RRRRtTextRR7tNONEttextHighlightSampleRtinserttENDR3ttag_bindRtDISABLEDR^tframeColourSetR_t GetColourRRtoptMenuHighlightTargett RadiobuttontSetColourSampleBindingtradioFgtradioBgRtSaveAsNewThemeRt SetThemeTypetradioThemeBuiltintradioThemeCustomtoptMenuThemeBuiltintoptMenuThemeCustomtDeleteCustomThemetbuttonDeleteCustomThemeRLRcRNRORRMRtEtRIGHTRRU(RBR+Rt frameCustomt frameThemeRXt textAndTagsttxTatelementRt frameFgBgtbuttonSetColourtbuttonSaveCustomThemetlabelTypeTitle((s*/usr/lib/python2.7/idlelib/configDialog.pyRQs            ("+ ( ""%%+%c Cs|j}t||_t||_t||_t||_t||_|jj dj }t |dddt dd}t |dddt dd}t |}t|dd}t|}t|d t}t|d td t|_|jjd |j|jd |jj|jd |jj|jjd|j|jjd|jt|ddd |jdt|_gtdD]$} t |dddddd^q} t| dd|jddd |j dd|_!t| dd|jddd |j dd|_"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-|j0dd d|j1dd d|j2d!dd"dd#dd$t3|jj2d!dd"dd$t4|j2d!dd"dd$t5|j2d!dd"dd$t6|j!j2d!dd"dd$t3t5|j"j2d!dd"dd$t3t5|j%j2d!dd"dd$t4|j&j2d!dd"dd$t4|j(j*dt/dt.dt7dd| j*dt/dt.dt7dd| dj*dt8dt-dt7| dj*dt8dt.dt7dd|S(%NRGR iRhRXs Custom Key Bindings s Key Set sAction - Key(s)RqR[RjsRZRktxscrollcommandsGet New Keys for SelectionRRVRWiRlRisUse a Built-in Key SetsUse a Custom Key SetsDelete Custom Key SetsSave as New Custom Key SetRIiRJRKtweighttrowtcolumnt columnspantsticky(9R+Rwt bindingTargett builtinKeyst customKeysRytkeysAreBuiltint keyBindingR<RRRRR^RRt HORIZONTALRR7t listBindingsRtKeyBindingSelectedRRtxviewRR_t GetNewKeysRt buttonNewKeystrangeRt SetKeysTypetradioKeysBuiltintradioKeysCustomRRtoptMenuKeysBuiltintoptMenuKeysCustomtDeleteCustomKeystbuttonDeleteCustomKeystSaveAsNewKeySetRLRURNRORRctcolumnconfiguret rowconfiguretgridRtNSEWtNStEWtTrueRM( RBR+RRt frameKeySetst frameTargettlabelTargetTitlet scrollTargetYt scrollTargetXtitframestbuttonSaveCustomKeys((s*/usr/lib/python2.7/idlelib/configDialog.pyRR%s~     4 ("%("##%" &c Cs|j}t||_t||_t||_t||_t||_t||_t ||_ t||_ |j j dj}t|dddtdd}t|dddtdd}t|dddt}t|dddt}t|dddt}t|dddtdd}t|dd } t|d |jd d d |jdd} t|d |jd dd |jdd} t|dd} t|d |jd dd |jdd} t|d |jd d d |jdd}t|dd}t|dd}t|d|jdd}t|dd}t|d|jdd}t|dd}t|d|jdd}t|dd}t|d |jd ddd}t|d |jd ddd}t|d |jd d dd!}t|}t|}t|}t|d"d#d$td%t|_|jd |jj|jjd&|j|jjd'|jt|dd(d)t dd*d |j!|_"t|dd+dd*d |j#|_$t|dd,d)t dd*d |j%|_&|j'd-t(d.d#d/d#d0t)|j'd-t(d.d#d/d#d0t)|j'd-t(d.d#d/d#d0t)|j'd-t(d.d#d/d#d0t)|j'd-t(d.d#d/d#d0t)|j'd-t(d.d#d/d#d1t*d0t+| j'd-t,d2t-d.d#d/d#| j'd-t.d2t-d.d#d/d#| j'd-t.d2t-d.d#d/d#| j'd-t,d2t-d.d#d/d#|j'd-t.d2t-d.d#d/d#| j'd-t.d2t-d.d#d/d#|j'd-t,d2t-d.d#d/d#|j'd-t.d2t/d.d3d/d#|j'd-t.d2t/d/d#|j'd-t.d2t/d.d3d/d#|j'd-t.d2t/d/d#|j'd-t,d2t-d.d#d/d#|j'd-t.d2t/d.d3d/d#|j'd-t,d2t-d.d#d/d#|j'd-t.d2t/d/d#|j'd-t.d2t/d/d#|j'd-t.d2t/d/d#|j'd-t.d.d#d/d#d0t0|j'd-t(d.d#d/d#d1t*d0t+|j'd-t.d2t-d0t0|jj'd-t,d2t/d1t*d0t+|j"j'd-t(d2t-d/d#|j$j'd-t(d2t-|j&j'd-t(d2t-d/d#|S(4NRHR iRhRXs Startup Preferences s Autosave Preferences s Additional Help Sources s At StartupRlRiRZsOpen Edit WindowisOpen Shell WindowsAt Start of Run (F5) sPrompt to Saves No Prompts$Initial Window Size (in characters)tWidtht textvariableR'itHeights(Paragraph reformat width (in characters)sDefault Source EncodingtlocalesLocale-definedsutf-8sUTF-8tnoneRR&iR[RjRkstEditRitAddtRemoveRIRVRWRKRJRvi (1R+RwtwinWidtht winHeightt paraWidthR|t startupEdittautoSavetencodingRytuserHelpBrowsert helpBrowserR<RRRRR^RRRtEntryRRR7tlistHelpRRRRtHelpSourceSelectedR_RtHelpListItemEdittbuttonHelpListEdittHelpListItemAddtbuttonHelpListAddtHelpListItemRemovetbuttonHelpListRemoveRLRMRRNRORcRRRR(RBR+RtframeRunt frameSavet frameWinSizet frameParaSizet frameEncodingt frameHelptlabelRunChoiceTitletradioStartupEdittradioStartupShelltlabelRunSaveTitlet radioSaveAskt radioSaveAutotlabelWinSizeTitletlabelWinWidthTitlet entryWinWidthtlabelWinHeightTitletentryWinHeighttlabelParaWidthTitletentryParaWidthtlabelEncodingTitletradioEncLocalet radioEncUTF8t radioEncNonet frameHelpListtframeHelpListButtonstscrollHelpList((s*/usr/lib/python2.7/idlelib/configDialog.pyRSrs         """""("""""""""""""(%cCs|jjd|j|jjd|j|jjd|j|jjd|j|j jd|j |j jd|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('Rxttrace_variabletVarChanged_fontSizeR{tVarChanged_fontNameRztVarChanged_fontBoldR}tVarChanged_spaceNumRtVarChanged_colourRtVarChanged_builtinThemeRtVarChanged_customThemeRtVarChanged_themeIsBuiltinRtVarChanged_highlightTargetRtVarChanged_keyBindingRtVarChanged_builtinKeysRtVarChanged_customKeysRtVarChanged_keysAreBuiltinRtVarChanged_winWidthRtVarChanged_winHeightRtVarChanged_paraWidthRtVarChanged_startupEditRtVarChanged_autoSaveRtVarChanged_encoding(RB((s*/usr/lib/python2.7/idlelib/configDialog.pyR?s&cGs)|jj}|jddd|dS(Ntmaint EditorWindows font-size(RxtgettAddChangedItem(RBtparamsR((s*/usr/lib/python2.7/idlelib/configDialog.pyR>scGs)|jj}|jddd|dS(NRQRRRp(R{RSRT(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyR? scGs)|jj}|jddd|dS(NRQRRs font-bold(RzRSRT(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyR@ scGs)|jj}|jddd|dS(NRQtIndents num-spaces(R}RSRT(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyRAscGs|jdS(N(tOnNewColourSet(RBRU((s*/usr/lib/python2.7/idlelib/configDialog.pyRBscGs3|jj}|jddd||jdS(NRQtThemetname(RRSRTtPaintThemeSample(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyRCscGsB|jj}|dkr>|jddd||jndS(Ns- no custom themes -RQRXRY(RRSRTRZ(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyRDs cGsF|jj}|jddd||r8|jn |jdS(NRQRXtdefault(RRSRTRCRD(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyRE#s  cGs|jdS(N(tSetHighlightTarget(RBRU((s*/usr/lib/python2.7/idlelib/configDialog.pyRF+scGs|jj}|jj}|jjtjd}tj|rb|jd|||n/tj |}|d}|jd|||dS(Nitkeyst _cfgBindingst extensions( RRSRRtANCHORtsplitRt IsCoreBindingRTtGetExtnNameForEvent(RBRURtkeySetRtextNametextKeybindSection((s*/usr/lib/python2.7/idlelib/configDialog.pyRG.s cGs6|jj}|jddd||j|dS(NRQRGRY(RRSRTt LoadKeysList(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyRH:scGsE|jj}|dkrA|jddd||j|ndS(Ns- no custom keys -RQRGRY(RRSRTRg(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyRI?s cGsF|jj}|jddd||r8|jn |jdS(NRQRGR[(RRSRTRHRI(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyRJEs  cGs)|jj}|jddd|dS(NRQRRR'(RRSRT(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyRKMscGs)|jj}|jddd|dS(NRQRRR&(RRSRT(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyRLQscGs)|jj}|jddd|dS(NRQtFormatParagrapht paragraph(RRSRT(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyRMUscGs)|jj}|jddd|dS(NRQRHseditor-on-startup(RRSRT(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyRNYscGs)|jj}|jddd|dS(NRQRHtautosave(RRSRT(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyRO]scGs)|jj}|jddd|dS(NRQRRR(RRSRT(RBRUR((s*/usr/lib/python2.7/idlelib/configDialog.pyRPascCs)iid6id6id6id6|_dS(NRQt highlightR]R_(t changedItems(RB((s*/usr/lib/python2.7/idlelib/configDialog.pyR4escCsLt|}||j|kr3i|j||tjddtjdd}t|d||j}|S(NtuserR]R[sNew Custom Key Set(RRqRR(RBRt usedNamesR((s*/usr/lib/python2.7/idlelib/configDialog.pyRs cCs)|jd}|r%|j|ndS(NsNew Key Set Name:(RR(RBt newKeysName((s*/usr/lib/python2.7/idlelib/configDialog.pyRscCs|jjdtdS(NR(RRR{(RBR((s*/usr/lib/python2.7/idlelib/configDialog.pyRsc Cs#|jjr!|jj}n|jj}tj|}i}x8|D]0}|dd!}dj||}||||jj}d}tjd||d|s5dStjdj|||jdkrm|jd|=ntjdjtj dd}|j |s|j j dt |jj|dn|jj||d|jjtjd jd d |jjtjd jd d |j|jdS( Ns0Are you sure you wish to delete the key set %r ?sDelete Key SetR+R]RRs- no custom keys -iRQRGR[RY(RRSt tkMessageBoxtaskyesnoRtuserCfgtremove_sectionRltSaveRqRRRRRRRRRrRtRR\R(RBRtdelmsgtitemList((s*/usr/lib/python2.7/idlelib/configDialog.pyRs& ## cCs>|jj}d}tjd||d|s5dStjdj|||jdkrm|jd|=ntjdjtj dd}|j |s|j j dt |jj|dn|jj||d|jjtjd jd d |jjtjd jd d |j|jdS( Ns.Are you sure you wish to delete the theme %r ?s Delete ThemeR+RkRRs- no custom themes -iRQRXR[RY(RRSRRRRRRlRRqRRRRRRRRRrRtRR\R(RBt themeNameRR((s*/usr/lib/python2.7/idlelib/configDialog.pyRs& ## cCs|jj}|jjd}tjd|dd|d|\}}|r||kr|jjrd}|j|}|sdS|j||j j |q|j j |ndS(NtbgR+R/sPick new colour for : t initialcolors_Your changes will be saved as a new Custom Theme. Enter a name for your new Custom Theme below.( RRSRtcgetttkColorChoosertaskcolorRtGetNewThemeNametCreateNewThemeRR(RBttargett prevColourt rgbTuplett colourStringRtnewTheme((s*/usr/lib/python2.7/idlelib/configDialog.pyR1s  cCs|jj}|jjd||jjr7dnd}|j|jjd}|jj|i||6|j j}|d|}|j d|||dS(NRt foregroundt backgroundit-Rk( RRSRRRR3RRt tag_configRRT(RBt newColourtplanet sampleElementtthemet themeElement((s*/usr/lib/python2.7/idlelib/configDialog.pyRWEscCs>tjddtjdd}t|d||j}|S(NRRkR[sNew Custom Theme(RRqRR(RBRRR((s*/usr/lib/python2.7/idlelib/configDialog.pyROs cCs)|jd}|r%|j|ndS(NsNew Theme Name:(RR(RBt newThemeName((s*/usr/lib/python2.7/idlelib/configDialog.pyRVscCs|jjr'd}|jj}nd}|jj}tj||}||jdkr|jd|}x|D]}|||||jjdt|jjdtn^|jjrv|jjdt|jjdtn&|jjdt|jjdtdS(NiR(RtsizeRRRR!RR{(RB((s*/usr/lib/python2.7/idlelib/configDialog.pyRscCsht|dj}|rZ|jj|d|df|jjt|d|jn|jdS(NsNew Help Sourceii( RRt userHelpListtappendRRRtUpdateUserHelpChangedItemsR(RBt helpSource((s*/usr/lib/python2.7/idlelib/configDialog.pyRs  cCs|jjt}|j|}t|dd|dd|dj}| sX||kr\dS||j|<|jj||jj||d|j|j dS(NsEdit Help SourcetmenuItemitfilePathi( RR|R`RRRRRRR(RBt itemIndexRt newHelpSource((s*/usr/lib/python2.7/idlelib/configDialog.pyRs   cCsD|jjt}|j|=|jj||j|jdS(N(RR|R`RRRR(RBR((s*/usr/lib/python2.7/idlelib/configDialog.pyR s   c Cspi|jddUs     cCsftjdj|s-tjdj|nx2|D]*}||}tjdj|||q4WdS(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(RRt has_sectiont add_sectiont SetOption(RBRRdRR((s*/usr/lib/python2.7/idlelib/configDialog.pyRds   cCsftjdj|s-tjdj|nx2|D]*}||}tjdj|||q4WdS(s save a newly created theme. themeName - string, the name of the new theme theme - dictionary containing the new theme RkN(RRRRR(RBRRRR((s*/usr/lib/python2.7/idlelib/configDialog.pyRps   cCsltj|j||rRtj|j|||krRtj|j||Sntj|j|||S(N(RRrt has_optionRtRt RemoveOptionR(RBRvRoRpR((s*/usr/lib/python2.7/idlelib/configDialog.pyt SetUserValue|scCstjdjx|jD]}t}x|j|D]}|dkrdtjdjdt}nxO|j||D]<}|j|||}|j||||rvt}qvqvWq5W|rtj|jqqWx%ddgD]}tj|jqW|jdS(s3Save configuration changes to the user config file.RQRR]RkN( RRRRltFalseRRRR4(RBRvtcfgTypeHasChangesRoRpR((s*/usr/lib/python2.7/idlelib/configDialog.pytSaveAllChangedConfigss   cCs+|jj}x|D]}|jqWdS(N(R+R,tRemoveKeybindings(RBt winInstancestinstance((s*/usr/lib/python2.7/idlelib/configDialog.pytDeactivateCurrentConfigs  cCsY|jjj}x@|D]8}|j|j|j|j|jqWdS(s'Dynamically apply configuration changesN(R+R,R]tResetColorizert ResetFonttset_notabs_indentwidthtApplyKeybindingstreset_help_menu_entries(RBR R ((s*/usr/lib/python2.7/idlelib/configDialog.pytActivateConfigChangess     cCs|jdS(N(tdestroy(RB((s*/usr/lib/python2.7/idlelib/configDialog.pyR;scCs|j|jdS(N(R\R(RB((s*/usr/lib/python2.7/idlelib/configDialog.pyRYs cCs"|j|j|jdS(N(R R R(RB((s*/usr/lib/python2.7/idlelib/configDialog.pyR\s  cCsdS(N((RB((s*/usr/lib/python2.7/idlelib/configDialog.pytHelpsN(Mt__name__t __module__RR*R5RTRPRQRRRSR?R>R?R@RARBRCRDRERFRGRHRIRJRKRLRMRNRORPR4RTRzRRRRRRRRgRRRRWRRRRRRR\RRRZRRRRR RRRRRRR>RRRR R RR;RYR\R(((s*/usr/lib/python2.7/idlelib/configDialog.pyRs4  D l M ~                     $                        !         tVerticalScrolledFramecBseZdZdZRS(sA pure Tkinter vertically scrollable frame. * Use the 'interior' attribute to place widgets inside the scrollable frame * Construct and pack/place/grid normally * This frame only allows vertical scrolling cs*tj||||t|dt}|jdtdtdtt|ddddd|j jdt dt dt |j d jjdjdt|_jddd d tfd }jd |fd}jd |dS(NRqRKRIRJtbdiRRkRZtwindowRvcsajjf}jdd|jjkr]jdjndS(Nt scrollregions 0 0 %s %sR'(twinfo_reqwidthtwinfo_reqheightRt winfo_width(RR(tcanvastinterior(s*/usr/lib/python2.7/idlelib/configDialog.pyt_configure_interiorss cs8jjkr4jdjndS(NR'(RRt itemconfigure(R(RR t interior_id(s*/usr/lib/python2.7/idlelib/configDialog.pyt_configure_canvass(R^R*RtVERTICALRLRRR7tCanvasRRcRORNRRt xview_movetot yview_movetoR t create_windowtNWR(RBR+Rtkwt vscrollbarR!R$((RR R#s*/usr/lib/python2.7/idlelib/configDialog.pyR*s    (RRt__doc__R*(((s*/usr/lib/python2.7/idlelib/configDialog.pyRscCs5|s tSyt|tSWntk r0tSXdS(s(Return 's is blank or represents an int'N(RRt ValueErrorR(R((s*/usr/lib/python2.7/idlelib/configDialog.pytis_ints  tConfigExtensionsDialogcBseZdZd edZdZdZej j Z dZ ej j Z dZ ejj ZdZdZdZRS( sA dialog for configuring IDLE extensions. This dialog is generic - it works for any and all IDLE extensions. IDLE extensions save their configuration options using idleConf. ConfigExtensionsDialog reads the current configuration using idleConf, supplies a GUI interface to change the configuration values, and saves the changes using idleConf. Not all changes take effect immediately - some may require restarting IDLE. This depends on each extension's implementation. All values are treated as text, and it is up to the user to supply reasonable values. The only exception to this are the 'enable*' options, which are boolean, and can be toggled with an True/False button. cCs^tj|||j|jdd|jd|jd|j|sUdndf|j|ppdtj d|_ tj d|_ |j t |_ |j |j|jd td t|j||jd |j|jj|j|j|jd |jd td t|j|sZ|j|jndS( NR is+%d+%diiisIDLE Extensions ConfigurationR_R&R'R(i(R)R*R-R.R0R1R2twm_titleRRrRtregisterR/tload_extensionstcreate_widgetsR6R7R8R:R;ttabbed_page_setR=tupdatet wm_minsizeRRNR@R9RA(RBR+R/RC((s*/usr/lib/python2.7/idlelib/configDialog.pyR*s. !       c Csi|_x'tjdtD]}g|j|yt |}d}Wq?t k r:|}d }q?XnXy+|jj ||d|dt d |}Wnt k r|}nXt|} | jt||j|ji|d 6|d6|d 6|d 6| d 6qWq=Wd S(sAFill self.extensions with data from the default and user configs.t active_onlytenabletrawRRRRRR[RYRtvarN(R_Rt GetExtensionsRtsortedRrRst startswithtremoveRtRtKeyErrorRR.RRRwRRmR( RBtext_nametopt_listtopt_nametenablestdef_strtdef_objtopt_typeRR;((s*/usr/lib/python2.7/idlelib/configDialog.pyR3$sH                c Cs|jddd|jddd|jdddt|d|jjdd dddtj|_|jjd dd dd t x|jD]}|j |qW|j jd dd S( sCreate the dialog's widgets.iRiREtn_rowstmax_tabs_per_rowit page_classRRRN( RRRR_R]Rt PageRemoveR5RRtcreate_tab_pageRT(RBRA((s*/usr/lib/python2.7/idlelib/configDialog.pyR4Qs c Cst|jj|jdddddtdd|}|jdtdtdd d dt|d dd d }|jd t dtdt |j }|j ddd|j dddxFt |j|D]1\}}t|d|d}|jd|dddt|d}|ddkr{t|d|d|dddddtdd d!d"jd|dddtdd#q|dd$krt|d|d%d&d'|jd(fjd|dddtdd#qt|d|jd|dddtdd#qWd)S(*s!Create the page for an extension.tborderiRVRhRXs %s RKRJi RWR&iRIiRiRYRRRR;RRR RlRmRRnRt indicatoront selectcolorR R'iiRtvalidateRtvalidatecommands%PN(RR5RRRRLRORRRURNR Rt enumerateR_RRR*RR7RRR/R( RBRAtpagetscrolled_framet entry_areaRtopttlabelR;((s*/usr/lib/python2.7/idlelib/configDialog.pyRLds2 "    cCs|jdS(N(tsave_all_changed_configs(RB((s*/usr/lib/python2.7/idlelib/configDialog.pyR\s cCsdS(N((RB((s*/usr/lib/python2.7/idlelib/configDialog.pyRscCsv|d}|d}|djjp-|}|dj|||kr`|jj||S|jj|||S(NRYR[R;(RStstripRRRR(RBRoRVRYR[R((s*/usr/lib/python2.7/idlelib/configDialog.pytset_user_values   cCsmt}xJ|jD]?}|j|}x)|D]!}|j||r*t}q*q*WqW|ri|jjndS(s3Save configuration changes to the user config file.N(RR_RZRRR(RBt has_changesRARxRV((s*/usr/lib/python2.7/idlelib/configDialog.pyRXs  N(RRR-RRR*R3R4RRTtim_funcRLRYR\R;RRZRX(((s*/usr/lib/python2.7/idlelib/configDialog.pyR0s -   %     t__main__s#idlelib.idle_test.test_configdialogt verbosityitexit(trun(R-tTkinterRRR~tidlelib.configHandlerRtidlelib.dynOptionMenuWidgetRtidlelib.tabbedpagesRtidlelib.keybindingDialogRtidlelib.configSectionNameDialogRtidlelib.configHelpSourceEditRtidlelibRR)RR^RR/R0RtunittestRQRtidlelib.idle_test.htestR`(((s*/usr/lib/python2.7/idlelib/configDialog.pyt s0 $-