SM0 She11
Path:
/
/
usr
/
lib64
/
python2.7
/
idlelib
Full Path (server): /usr/lib64/python2.7/idlelib
Create Fil3
Upl04d Fil3
📄 AutoComplete.py
[E]
[D]
[R]
📄 AutoComplete.pyc
[E]
[D]
[R]
📄 AutoComplete.pyo
[E]
[D]
[R]
📄 AutoCompleteWindow.py
[E]
[D]
[R]
📄 AutoCompleteWindow.pyc
[E]
[D]
[R]
📄 AutoCompleteWindow.pyo
[E]
[D]
[R]
📄 AutoExpand.py
[E]
[D]
[R]
📄 AutoExpand.pyc
[E]
[D]
[R]
📄 AutoExpand.pyo
[E]
[D]
[R]
📄 Bindings.py
[E]
[D]
[R]
📄 Bindings.pyc
[E]
[D]
[R]
📄 Bindings.pyo
[E]
[D]
[R]
📄 CREDITS.txt
[E]
[D]
[R]
📄 CallTipWindow.py
[E]
[D]
[R]
📄 CallTipWindow.pyc
[E]
[D]
[R]
📄 CallTipWindow.pyo
[E]
[D]
[R]
📄 CallTips.py
[E]
[D]
[R]
📄 CallTips.pyc
[E]
[D]
[R]
📄 CallTips.pyo
[E]
[D]
[R]
📄 ChangeLog
[E]
[D]
[R]
📄 ClassBrowser.py
[E]
[D]
[R]
📄 ClassBrowser.pyc
[E]
[D]
[R]
📄 ClassBrowser.pyo
[E]
[D]
[R]
📄 CodeContext.py
[E]
[D]
[R]
📄 CodeContext.pyc
[E]
[D]
[R]
📄 CodeContext.pyo
[E]
[D]
[R]
📄 ColorDelegator.py
[E]
[D]
[R]
📄 ColorDelegator.pyc
[E]
[D]
[R]
📄 ColorDelegator.pyo
[E]
[D]
[R]
📄 Debugger.py
[E]
[D]
[R]
📄 Debugger.pyc
[E]
[D]
[R]
📄 Debugger.pyo
[E]
[D]
[R]
📄 Delegator.py
[E]
[D]
[R]
📄 Delegator.pyc
[E]
[D]
[R]
📄 Delegator.pyo
[E]
[D]
[R]
📄 EditorWindow.py
[E]
[D]
[R]
📄 EditorWindow.pyc
[E]
[D]
[R]
📄 EditorWindow.pyo
[E]
[D]
[R]
📄 FileList.py
[E]
[D]
[R]
📄 FileList.pyc
[E]
[D]
[R]
📄 FileList.pyo
[E]
[D]
[R]
📄 FormatParagraph.py
[E]
[D]
[R]
📄 FormatParagraph.pyc
[E]
[D]
[R]
📄 FormatParagraph.pyo
[E]
[D]
[R]
📄 GrepDialog.py
[E]
[D]
[R]
📄 GrepDialog.pyc
[E]
[D]
[R]
📄 GrepDialog.pyo
[E]
[D]
[R]
📄 HISTORY.txt
[E]
[D]
[R]
📄 HyperParser.py
[E]
[D]
[R]
📄 HyperParser.pyc
[E]
[D]
[R]
📄 HyperParser.pyo
[E]
[D]
[R]
📄 IOBinding.py
[E]
[D]
[R]
📄 IOBinding.pyc
[E]
[D]
[R]
📄 IOBinding.pyo
[E]
[D]
[R]
📁 Icons
Open
[D]
[R]
📄 IdleHistory.py
[E]
[D]
[R]
📄 IdleHistory.pyc
[E]
[D]
[R]
📄 IdleHistory.pyo
[E]
[D]
[R]
📄 MultiCall.py
[E]
[D]
[R]
📄 MultiCall.pyc
[E]
[D]
[R]
📄 MultiCall.pyo
[E]
[D]
[R]
📄 MultiStatusBar.py
[E]
[D]
[R]
📄 MultiStatusBar.pyc
[E]
[D]
[R]
📄 MultiStatusBar.pyo
[E]
[D]
[R]
📄 NEWS.txt
[E]
[D]
[R]
📄 ObjectBrowser.py
[E]
[D]
[R]
📄 ObjectBrowser.pyc
[E]
[D]
[R]
📄 ObjectBrowser.pyo
[E]
[D]
[R]
📄 OutputWindow.py
[E]
[D]
[R]
📄 OutputWindow.pyc
[E]
[D]
[R]
📄 OutputWindow.pyo
[E]
[D]
[R]
📄 ParenMatch.py
[E]
[D]
[R]
📄 ParenMatch.pyc
[E]
[D]
[R]
📄 ParenMatch.pyo
[E]
[D]
[R]
📄 PathBrowser.py
[E]
[D]
[R]
📄 PathBrowser.pyc
[E]
[D]
[R]
📄 PathBrowser.pyo
[E]
[D]
[R]
📄 Percolator.py
[E]
[D]
[R]
📄 Percolator.pyc
[E]
[D]
[R]
📄 Percolator.pyo
[E]
[D]
[R]
📄 PyParse.py
[E]
[D]
[R]
📄 PyParse.pyc
[E]
[D]
[R]
📄 PyParse.pyo
[E]
[D]
[R]
📄 PyShell.py
[E]
[D]
[R]
📄 PyShell.pyc
[E]
[D]
[R]
📄 PyShell.pyo
[E]
[D]
[R]
📄 README.txt
[E]
[D]
[R]
📄 RemoteDebugger.py
[E]
[D]
[R]
📄 RemoteDebugger.pyc
[E]
[D]
[R]
📄 RemoteDebugger.pyo
[E]
[D]
[R]
📄 RemoteObjectBrowser.py
[E]
[D]
[R]
📄 RemoteObjectBrowser.pyc
[E]
[D]
[R]
📄 RemoteObjectBrowser.pyo
[E]
[D]
[R]
📄 ReplaceDialog.py
[E]
[D]
[R]
📄 ReplaceDialog.pyc
[E]
[D]
[R]
📄 ReplaceDialog.pyo
[E]
[D]
[R]
📄 RstripExtension.py
[E]
[D]
[R]
📄 RstripExtension.pyc
[E]
[D]
[R]
📄 RstripExtension.pyo
[E]
[D]
[R]
📄 ScriptBinding.py
[E]
[D]
[R]
📄 ScriptBinding.pyc
[E]
[D]
[R]
📄 ScriptBinding.pyo
[E]
[D]
[R]
📄 ScrolledList.py
[E]
[D]
[R]
📄 ScrolledList.pyc
[E]
[D]
[R]
📄 ScrolledList.pyo
[E]
[D]
[R]
📄 SearchDialog.py
[E]
[D]
[R]
📄 SearchDialog.pyc
[E]
[D]
[R]
📄 SearchDialog.pyo
[E]
[D]
[R]
📄 SearchDialogBase.py
[E]
[D]
[R]
📄 SearchDialogBase.pyc
[E]
[D]
[R]
📄 SearchDialogBase.pyo
[E]
[D]
[R]
📄 SearchEngine.py
[E]
[D]
[R]
📄 SearchEngine.pyc
[E]
[D]
[R]
📄 SearchEngine.pyo
[E]
[D]
[R]
📄 StackViewer.py
[E]
[D]
[R]
📄 StackViewer.pyc
[E]
[D]
[R]
📄 StackViewer.pyo
[E]
[D]
[R]
📄 TODO.txt
[E]
[D]
[R]
📄 ToolTip.py
[E]
[D]
[R]
📄 ToolTip.pyc
[E]
[D]
[R]
📄 ToolTip.pyo
[E]
[D]
[R]
📄 TreeWidget.py
[E]
[D]
[R]
📄 TreeWidget.pyc
[E]
[D]
[R]
📄 TreeWidget.pyo
[E]
[D]
[R]
📄 UndoDelegator.py
[E]
[D]
[R]
📄 UndoDelegator.pyc
[E]
[D]
[R]
📄 UndoDelegator.pyo
[E]
[D]
[R]
📄 WidgetRedirector.py
[E]
[D]
[R]
📄 WidgetRedirector.pyc
[E]
[D]
[R]
📄 WidgetRedirector.pyo
[E]
[D]
[R]
📄 WindowList.py
[E]
[D]
[R]
📄 WindowList.pyc
[E]
[D]
[R]
📄 WindowList.pyo
[E]
[D]
[R]
📄 ZoomHeight.py
[E]
[D]
[R]
📄 ZoomHeight.pyc
[E]
[D]
[R]
📄 ZoomHeight.pyo
[E]
[D]
[R]
📄 __init__.py
[E]
[D]
[R]
📄 __init__.pyc
[E]
[D]
[R]
📄 __init__.pyo
[E]
[D]
[R]
📄 aboutDialog.py
[E]
[D]
[R]
📄 aboutDialog.pyc
[E]
[D]
[R]
📄 aboutDialog.pyo
[E]
[D]
[R]
📄 config-extensions.def
[E]
[D]
[R]
📄 config-highlight.def
[E]
[D]
[R]
📄 config-keys.def
[E]
[D]
[R]
📄 config-main.def
[E]
[D]
[R]
📄 configDialog.py
[E]
[D]
[R]
📄 configDialog.pyc
[E]
[D]
[R]
📄 configDialog.pyo
[E]
[D]
[R]
📄 configHandler.py
[E]
[D]
[R]
📄 configHandler.pyc
[E]
[D]
[R]
📄 configHandler.pyo
[E]
[D]
[R]
📄 configHelpSourceEdit.py
[E]
[D]
[R]
📄 configHelpSourceEdit.pyc
[E]
[D]
[R]
📄 configHelpSourceEdit.pyo
[E]
[D]
[R]
📄 configSectionNameDialog.py
[E]
[D]
[R]
📄 configSectionNameDialog.pyc
[E]
[D]
[R]
📄 configSectionNameDialog.pyo
[E]
[D]
[R]
📄 dynOptionMenuWidget.py
[E]
[D]
[R]
📄 dynOptionMenuWidget.pyc
[E]
[D]
[R]
📄 dynOptionMenuWidget.pyo
[E]
[D]
[R]
📄 extend.txt
[E]
[D]
[R]
📄 help.txt
[E]
[D]
[R]
📄 idle.py
[E]
[D]
[R]
📄 idle.pyc
[E]
[D]
[R]
📄 idle.pyo
[E]
[D]
[R]
📄 idle.pyw
[E]
[D]
[R]
📄 idlever.py
[E]
[D]
[R]
📄 idlever.pyc
[E]
[D]
[R]
📄 idlever.pyo
[E]
[D]
[R]
📄 keybindingDialog.py
[E]
[D]
[R]
📄 keybindingDialog.pyc
[E]
[D]
[R]
📄 keybindingDialog.pyo
[E]
[D]
[R]
📄 macosxSupport.py
[E]
[D]
[R]
📄 macosxSupport.pyc
[E]
[D]
[R]
📄 macosxSupport.pyo
[E]
[D]
[R]
📄 rpc.py
[E]
[D]
[R]
📄 rpc.pyc
[E]
[D]
[R]
📄 rpc.pyo
[E]
[D]
[R]
📄 run.py
[E]
[D]
[R]
📄 run.pyc
[E]
[D]
[R]
📄 run.pyo
[E]
[D]
[R]
📄 tabbedpages.py
[E]
[D]
[R]
📄 tabbedpages.pyc
[E]
[D]
[R]
📄 tabbedpages.pyo
[E]
[D]
[R]
📄 textView.py
[E]
[D]
[R]
📄 textView.pyc
[E]
[D]
[R]
📄 textView.pyo
[E]
[D]
[R]
Editing: keybindingDialog.py
""" Dialog for building Tkinter accelerator key bindings """ from Tkinter import * import tkMessageBox import string class GetKeysDialog(Toplevel): def __init__(self,parent,title,action,currentKeySequences): """ action - string, the name of the virtual event these keys will be mapped to currentKeys - list, a list of all key sequence lists currently mapped to virtual events, for overlap checking """ Toplevel.__init__(self, parent) self.configure(borderwidth=5) self.resizable(height=FALSE,width=FALSE) self.title(title) self.transient(parent) self.grab_set() self.protocol("WM_DELETE_WINDOW", self.Cancel) self.parent = parent self.action=action self.currentKeySequences=currentKeySequences self.result='' self.keyString=StringVar(self) self.keyString.set('') self.SetModifiersForPlatform() # set self.modifiers, self.modifier_label self.modifier_vars = [] for modifier in self.modifiers: variable = StringVar(self) variable.set('') self.modifier_vars.append(variable) self.advanced = False self.CreateWidgets() self.LoadFinalKeyList() self.withdraw() #hide while setting geometry self.update_idletasks() self.geometry("+%d+%d" % ((parent.winfo_rootx()+((parent.winfo_width()/2) -(self.winfo_reqwidth()/2)), parent.winfo_rooty()+((parent.winfo_height()/2) -(self.winfo_reqheight()/2)) )) ) #centre dialog over parent self.deiconify() #geometry set, unhide self.wait_window() def CreateWidgets(self): frameMain = Frame(self,borderwidth=2,relief=SUNKEN) frameMain.pack(side=TOP,expand=TRUE,fill=BOTH) frameButtons=Frame(self) frameButtons.pack(side=BOTTOM,fill=X) self.buttonOK = Button(frameButtons,text='OK', width=8,command=self.OK) self.buttonOK.grid(row=0,column=0,padx=5,pady=5) self.buttonCancel = Button(frameButtons,text='Cancel', width=8,command=self.Cancel) self.buttonCancel.grid(row=0,column=1,padx=5,pady=5) self.frameKeySeqBasic = Frame(frameMain) self.frameKeySeqAdvanced = Frame(frameMain) self.frameControlsBasic = Frame(frameMain) self.frameHelpAdvanced = Frame(frameMain) self.frameKeySeqAdvanced.grid(row=0,column=0,sticky=NSEW,padx=5,pady=5) self.frameKeySeqBasic.grid(row=0,column=0,sticky=NSEW,padx=5,pady=5) self.frameKeySeqBasic.lift() self.frameHelpAdvanced.grid(row=1,column=0,sticky=NSEW,padx=5) self.frameControlsBasic.grid(row=1,column=0,sticky=NSEW,padx=5) self.frameControlsBasic.lift() self.buttonLevel = Button(frameMain,command=self.ToggleLevel, text='Advanced Key Binding Entry >>') self.buttonLevel.grid(row=2,column=0,stick=EW,padx=5,pady=5) labelTitleBasic = Label(self.frameKeySeqBasic, text="New keys for '"+self.action+"' :") labelTitleBasic.pack(anchor=W) labelKeysBasic = Label(self.frameKeySeqBasic,justify=LEFT, textvariable=self.keyString,relief=GROOVE,borderwidth=2) labelKeysBasic.pack(ipadx=5,ipady=5,fill=X) self.modifier_checkbuttons = {} column = 0 for modifier, variable in zip(self.modifiers, self.modifier_vars): label = self.modifier_label.get(modifier, modifier) check=Checkbutton(self.frameControlsBasic, command=self.BuildKeyString, text=label,variable=variable,onvalue=modifier,offvalue='') check.grid(row=0,column=column,padx=2,sticky=W) self.modifier_checkbuttons[modifier] = check column += 1 labelFnAdvice=Label(self.frameControlsBasic,justify=LEFT, text=\ "Select the desired modifier keys\n"+ "above, and the final key from the\n"+ "list on the right.\n\n" + "Use upper case Symbols when using\n" + "the Shift modifier. (Letters will be\n" + "converted automatically.)") labelFnAdvice.grid(row=1,column=0,columnspan=4,padx=2,sticky=W) self.listKeysFinal=Listbox(self.frameControlsBasic,width=15,height=10, selectmode=SINGLE) self.listKeysFinal.bind('<ButtonRelease-1>',self.FinalKeySelected) self.listKeysFinal.grid(row=0,column=4,rowspan=4,sticky=NS) scrollKeysFinal=Scrollbar(self.frameControlsBasic,orient=VERTICAL, command=self.listKeysFinal.yview) self.listKeysFinal.config(yscrollcommand=scrollKeysFinal.set) scrollKeysFinal.grid(row=0,column=5,rowspan=4,sticky=NS) self.buttonClear=Button(self.frameControlsBasic, text='Clear Keys',command=self.ClearKeySeq) self.buttonClear.grid(row=2,column=0,columnspan=4) labelTitleAdvanced = Label(self.frameKeySeqAdvanced,justify=LEFT, text="Enter new binding(s) for '"+self.action+"' :\n"+ "(These bindings will not be checked for validity!)") labelTitleAdvanced.pack(anchor=W) self.entryKeysAdvanced=Entry(self.frameKeySeqAdvanced, textvariable=self.keyString) self.entryKeysAdvanced.pack(fill=X) labelHelpAdvanced=Label(self.frameHelpAdvanced,justify=LEFT, text="Key bindings are specified using Tkinter keysyms as\n"+ "in these samples: <Control-f>, <Shift-F2>, <F12>,\n" "<Control-space>, <Meta-less>, <Control-Alt-Shift-X>.\n" "Upper case is used when the Shift modifier is present!\n\n" + "'Emacs style' multi-keystroke bindings are specified as\n" + "follows: <Control-x><Control-y>, where the first key\n" + "is the 'do-nothing' keybinding.\n\n" + "Multiple separate bindings for one action should be\n"+ "separated by a space, eg., <Alt-v> <Meta-v>." ) labelHelpAdvanced.grid(row=0,column=0,sticky=NSEW) def SetModifiersForPlatform(self): """Determine list of names of key modifiers for this platform. The names are used to build Tk bindings -- it doesn't matter if the keyboard has these keys, it matters if Tk understands them. The order is also important: key binding equality depends on it, so config-keys.def must use the same ordering. """ from idlelib import macosxSupport if macosxSupport.runningAsOSXApp(): self.modifiers = ['Shift', 'Control', 'Option', 'Command'] else: self.modifiers = ['Control', 'Alt', 'Shift'] self.modifier_label = {'Control': 'Ctrl'} # short name def ToggleLevel(self): if self.buttonLevel.cget('text')[:8]=='Advanced': self.ClearKeySeq() self.buttonLevel.config(text='<< Basic Key Binding Entry') self.frameKeySeqAdvanced.lift() self.frameHelpAdvanced.lift() self.entryKeysAdvanced.focus_set() self.advanced = True else: self.ClearKeySeq() self.buttonLevel.config(text='Advanced Key Binding Entry >>') self.frameKeySeqBasic.lift() self.frameControlsBasic.lift() self.advanced = False def FinalKeySelected(self,event): self.BuildKeyString() def BuildKeyString(self): keyList = modifiers = self.GetModifiers() finalKey = self.listKeysFinal.get(ANCHOR) if finalKey: finalKey = self.TranslateKey(finalKey, modifiers) keyList.append(finalKey) self.keyString.set('<' + string.join(keyList,'-') + '>') def GetModifiers(self): modList = [variable.get() for variable in self.modifier_vars] return [mod for mod in modList if mod] def ClearKeySeq(self): self.listKeysFinal.select_clear(0,END) self.listKeysFinal.yview(MOVETO, '0.0') for variable in self.modifier_vars: variable.set('') self.keyString.set('') def LoadFinalKeyList(self): #these tuples are also available for use in validity checks self.functionKeys=('F1','F2','F2','F4','F5','F6','F7','F8','F9', 'F10','F11','F12') self.alphanumKeys=tuple(string.ascii_lowercase+string.digits) self.punctuationKeys=tuple('~!@#%^&*()_-+={}[]|;:,.<>/?') self.whitespaceKeys=('Tab','Space','Return') self.editKeys=('BackSpace','Delete','Insert') self.moveKeys=('Home','End','Page Up','Page Down','Left Arrow', 'Right Arrow','Up Arrow','Down Arrow') #make a tuple of most of the useful common 'final' keys keys=(self.alphanumKeys+self.punctuationKeys+self.functionKeys+ self.whitespaceKeys+self.editKeys+self.moveKeys) self.listKeysFinal.insert(END, *keys) def TranslateKey(self, key, modifiers): "Translate from keycap symbol to the Tkinter keysym" translateDict = {'Space':'space', '~':'asciitilde','!':'exclam','@':'at','#':'numbersign', '%':'percent','^':'asciicircum','&':'ampersand','*':'asterisk', '(':'parenleft',')':'parenright','_':'underscore','-':'minus', '+':'plus','=':'equal','{':'braceleft','}':'braceright', '[':'bracketleft',']':'bracketright','|':'bar',';':'semicolon', ':':'colon',',':'comma','.':'period','<':'less','>':'greater', '/':'slash','?':'question','Page Up':'Prior','Page Down':'Next', 'Left Arrow':'Left','Right Arrow':'Right','Up Arrow':'Up', 'Down Arrow': 'Down', 'Tab':'Tab'} if key in translateDict.keys(): key = translateDict[key] if 'Shift' in modifiers and key in string.ascii_lowercase: key = key.upper() key = 'Key-' + key return key def OK(self, event=None): if self.advanced or self.KeysOK(): # doesn't check advanced string yet self.result=self.keyString.get() self.destroy() def Cancel(self, event=None): self.result='' self.destroy() def KeysOK(self): '''Validity check on user's 'basic' keybinding selection. Doesn't check the string produced by the advanced dialog because 'modifiers' isn't set. ''' keys = self.keyString.get() keys.strip() finalKey = self.listKeysFinal.get(ANCHOR) modifiers = self.GetModifiers() # create a key sequence list for overlap check: keySequence = keys.split() keysOK = False title = 'Key Sequence Error' if not keys: tkMessageBox.showerror(title=title, parent=self, message='No keys specified.') elif not keys.endswith('>'): tkMessageBox.showerror(title=title, parent=self, message='Missing the final Key') elif (not modifiers and finalKey not in self.functionKeys + self.moveKeys): tkMessageBox.showerror(title=title, parent=self, message='No modifier key(s) specified.') elif (modifiers == ['Shift']) \ and (finalKey not in self.functionKeys + self.moveKeys + ('Tab', 'Space')): msg = 'The shift modifier by itself may not be used with'\ ' this key symbol.' tkMessageBox.showerror(title=title, parent=self, message=msg) elif keySequence in self.currentKeySequences: msg = 'This key combination is already in use.' tkMessageBox.showerror(title=title, parent=self, message=msg) else: keysOK = True return keysOK if __name__ == '__main__': #test the dialog root=Tk() def run(): keySeq='' dlg=GetKeysDialog(root,'Get Keys','find-again',[]) print dlg.result Button(root,text='Dialog',command=run).pack() root.mainloop()
Save