golden hour
/opt/alt/python27/lib64/python2.7/idlelib
⬆️ Go Up
Upload
File/Folder
Size
Actions
AutoComplete.py
8.75 KB
Del
OK
AutoComplete.pyc
7.99 KB
Del
OK
AutoComplete.pyo
7.99 KB
Del
OK
AutoCompleteWindow.py
16.91 KB
Del
OK
AutoCompleteWindow.pyc
12.42 KB
Del
OK
AutoCompleteWindow.pyo
12.36 KB
Del
OK
AutoExpand.py
3.32 KB
Del
OK
AutoExpand.pyc
3.5 KB
Del
OK
AutoExpand.pyo
3.5 KB
Del
OK
Bindings.py
2.91 KB
Del
OK
Bindings.pyc
4.6 KB
Del
OK
Bindings.pyo
4.6 KB
Del
OK
CREDITS.txt
1.82 KB
Del
OK
CallTipWindow.py
5.92 KB
Del
OK
CallTipWindow.pyc
6.14 KB
Del
OK
CallTipWindow.pyo
6.14 KB
Del
OK
CallTips.py
7.56 KB
Del
OK
CallTips.pyc
8.16 KB
Del
OK
CallTips.pyo
8.16 KB
Del
OK
ChangeLog
55.07 KB
Del
OK
ClassBrowser.py
6.83 KB
Del
OK
ClassBrowser.pyc
9.66 KB
Del
OK
ClassBrowser.pyo
9.66 KB
Del
OK
CodeContext.py
8.15 KB
Del
OK
CodeContext.pyc
6.63 KB
Del
OK
CodeContext.pyo
6.59 KB
Del
OK
ColorDelegator.py
9.53 KB
Del
OK
ColorDelegator.pyc
8.91 KB
Del
OK
ColorDelegator.pyo
8.91 KB
Del
OK
Debugger.py
17.81 KB
Del
OK
Debugger.pyc
17.72 KB
Del
OK
Debugger.pyo
17.72 KB
Del
OK
Delegator.py
665 B
Del
OK
Delegator.pyc
1.31 KB
Del
OK
Delegator.pyo
1.31 KB
Del
OK
EditorWindow.py
63.96 KB
Del
OK
EditorWindow.pyc
57.15 KB
Del
OK
EditorWindow.pyo
57.05 KB
Del
OK
FileList.py
3.63 KB
Del
OK
FileList.pyc
4.07 KB
Del
OK
FileList.pyo
4.04 KB
Del
OK
FormatParagraph.py
7.12 KB
Del
OK
FormatParagraph.pyc
7.14 KB
Del
OK
FormatParagraph.pyo
7.14 KB
Del
OK
GrepDialog.py
5.02 KB
Del
OK
GrepDialog.pyc
6.45 KB
Del
OK
GrepDialog.pyo
6.45 KB
Del
OK
HISTORY.txt
10.08 KB
Del
OK
HyperParser.py
10.25 KB
Del
OK
HyperParser.pyc
6.64 KB
Del
OK
HyperParser.pyo
6.64 KB
Del
OK
IOBinding.py
21.4 KB
Del
OK
IOBinding.pyc
18.62 KB
Del
OK
IOBinding.pyo
18.62 KB
Del
OK
Icons
-
Del
OK
IdleHistory.py
3.96 KB
Del
OK
IdleHistory.pyc
4.05 KB
Del
OK
IdleHistory.pyo
4.05 KB
Del
OK
MultiCall.py
17.29 KB
Del
OK
MultiCall.pyc
16.4 KB
Del
OK
MultiCall.pyo
16.33 KB
Del
OK
MultiStatusBar.py
1.32 KB
Del
OK
MultiStatusBar.pyc
2.3 KB
Del
OK
MultiStatusBar.pyo
2.3 KB
Del
OK
NEWS.txt
46.14 KB
Del
OK
ObjectBrowser.py
4.27 KB
Del
OK
ObjectBrowser.pyc
7.26 KB
Del
OK
ObjectBrowser.pyo
7.26 KB
Del
OK
OutputWindow.py
4.47 KB
Del
OK
OutputWindow.pyc
5.3 KB
Del
OK
OutputWindow.pyo
5.3 KB
Del
OK
ParenMatch.py
6.56 KB
Del
OK
ParenMatch.pyc
7.18 KB
Del
OK
ParenMatch.pyo
7.18 KB
Del
OK
PathBrowser.py
2.94 KB
Del
OK
PathBrowser.pyc
4.57 KB
Del
OK
PathBrowser.pyo
4.57 KB
Del
OK
Percolator.py
3.15 KB
Del
OK
Percolator.pyc
4.69 KB
Del
OK
Percolator.pyo
4.51 KB
Del
OK
PyParse.py
19.05 KB
Del
OK
PyParse.pyc
9.99 KB
Del
OK
PyParse.pyo
9.56 KB
Del
OK
PyShell.py
57.49 KB
Del
OK
PyShell.pyc
53 KB
Del
OK
PyShell.pyo
52.9 KB
Del
OK
README.txt
7.71 KB
Del
OK
RemoteDebugger.py
11.36 KB
Del
OK
RemoteDebugger.pyc
16.73 KB
Del
OK
RemoteDebugger.pyo
16.58 KB
Del
OK
RemoteObjectBrowser.py
942 B
Del
OK
RemoteObjectBrowser.pyc
2.23 KB
Del
OK
RemoteObjectBrowser.pyo
2.23 KB
Del
OK
ReplaceDialog.py
6.48 KB
Del
OK
ReplaceDialog.pyc
7.83 KB
Del
OK
ReplaceDialog.pyo
7.83 KB
Del
OK
RstripExtension.py
1.03 KB
Del
OK
RstripExtension.pyc
1.63 KB
Del
OK
RstripExtension.pyo
1.63 KB
Del
OK
ScriptBinding.py
8.26 KB
Del
OK
ScriptBinding.pyc
8.17 KB
Del
OK
ScriptBinding.pyo
8.17 KB
Del
OK
ScrolledList.py
4.27 KB
Del
OK
ScrolledList.pyc
6.61 KB
Del
OK
ScrolledList.pyo
6.61 KB
Del
OK
SearchDialog.py
2.57 KB
Del
OK
SearchDialog.pyc
4.04 KB
Del
OK
SearchDialog.pyo
4.04 KB
Del
OK
SearchDialogBase.py
6.93 KB
Del
OK
SearchDialogBase.pyc
8.43 KB
Del
OK
SearchDialogBase.pyo
8.43 KB
Del
OK
SearchEngine.py
7.29 KB
Del
OK
SearchEngine.pyc
8.37 KB
Del
OK
SearchEngine.pyo
8.37 KB
Del
OK
StackViewer.py
4.33 KB
Del
OK
StackViewer.pyc
6.52 KB
Del
OK
StackViewer.pyo
6.52 KB
Del
OK
TODO.txt
8.28 KB
Del
OK
ToolTip.py
3.1 KB
Del
OK
ToolTip.pyc
4.78 KB
Del
OK
ToolTip.pyo
4.78 KB
Del
OK
TreeWidget.py
14.68 KB
Del
OK
TreeWidget.pyc
17.95 KB
Del
OK
TreeWidget.pyo
17.95 KB
Del
OK
UndoDelegator.py
10.53 KB
Del
OK
UndoDelegator.pyc
13.88 KB
Del
OK
UndoDelegator.pyo
13.88 KB
Del
OK
WidgetRedirector.py
6.74 KB
Del
OK
WidgetRedirector.pyc
7.76 KB
Del
OK
WidgetRedirector.pyo
7.76 KB
Del
OK
WindowList.py
2.42 KB
Del
OK
WindowList.pyc
3.74 KB
Del
OK
WindowList.pyo
3.74 KB
Del
OK
ZoomHeight.py
1.27 KB
Del
OK
ZoomHeight.pyc
1.67 KB
Del
OK
ZoomHeight.pyo
1.67 KB
Del
OK
__init__.py
288 B
Del
OK
__init__.pyc
444 B
Del
OK
__init__.pyo
444 B
Del
OK
aboutDialog.py
6.85 KB
Del
OK
aboutDialog.pyc
6.85 KB
Del
OK
aboutDialog.pyo
6.85 KB
Del
OK
config-extensions.def
2.9 KB
Del
OK
config-highlight.def
2.46 KB
Del
OK
config-keys.def
7.59 KB
Del
OK
config-main.def
2.5 KB
Del
OK
configDialog.py
64.41 KB
Del
OK
configDialog.pyc
53.16 KB
Del
OK
configDialog.pyo
53.16 KB
Del
OK
configHandler.py
31.72 KB
Del
OK
configHandler.pyc
29.28 KB
Del
OK
configHandler.pyo
29.28 KB
Del
OK
configHelpSourceEdit.py
6.53 KB
Del
OK
configHelpSourceEdit.pyc
6.55 KB
Del
OK
configHelpSourceEdit.pyo
6.55 KB
Del
OK
configSectionNameDialog.py
3.95 KB
Del
OK
configSectionNameDialog.pyc
4.4 KB
Del
OK
configSectionNameDialog.pyo
4.4 KB
Del
OK
dynOptionMenuWidget.py
1.94 KB
Del
OK
dynOptionMenuWidget.pyc
2.8 KB
Del
OK
dynOptionMenuWidget.pyo
2.8 KB
Del
OK
extend.txt
3.56 KB
Del
OK
help.html
41.42 KB
Del
OK
help.py
10.78 KB
Del
OK
help.pyc
12.25 KB
Del
OK
help.pyo
12.25 KB
Del
OK
help.txt
11.86 KB
Del
OK
idle.py
453 B
Del
OK
idle.pyc
423 B
Del
OK
idle.pyo
423 B
Del
OK
idle.pyw
563 B
Del
OK
idle_test
-
Del
OK
idlever.py
415 B
Del
OK
idlever.pyc
591 B
Del
OK
idlever.pyo
591 B
Del
OK
keybindingDialog.py
12.18 KB
Del
OK
keybindingDialog.pyc
12.08 KB
Del
OK
keybindingDialog.pyo
12.08 KB
Del
OK
macosxSupport.py
8.24 KB
Del
OK
macosxSupport.pyc
8.38 KB
Del
OK
macosxSupport.pyo
8.25 KB
Del
OK
rpc.py
19.68 KB
Del
OK
rpc.pyc
21.97 KB
Del
OK
rpc.pyo
21.86 KB
Del
OK
run.py
12.61 KB
Del
OK
run.pyc
13.45 KB
Del
OK
run.pyo
13.39 KB
Del
OK
tabbedpages.py
18.01 KB
Del
OK
tabbedpages.pyc
18.63 KB
Del
OK
tabbedpages.pyo
18.63 KB
Del
OK
textView.py
3.44 KB
Del
OK
textView.pyc
4.02 KB
Del
OK
textView.pyo
4.02 KB
Del
OK
Edit: keybindingDialog.py
""" Dialog for building Tkinter accelerator key bindings """ from Tkinter import * import tkMessageBox import string import sys class GetKeysDialog(Toplevel): def __init__(self,parent,title,action,currentKeySequences,_htest=False): """ 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 _htest - bool, change box location when running htest """ 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) if not _htest else 150) ) ) #centre dialog over parent (or below htest box) 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. """ if sys.platform == "darwin": 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','F3','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.grab_release() self.destroy() def Cancel(self, event=None): self.result='' self.grab_release() 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__': from idlelib.idle_test.htest import run run(GetKeysDialog)
Save