OXIESEC PANEL
- Current Dir:
/
/
snap
/
core
/
17212
/
usr
/
lib
/
python3.5
/
idlelib
Server IP: 10.0.0.4
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/08/2025 02:18:07 PM
rwxr-xr-x
📄
AutoComplete.py
8.99 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
AutoCompleteWindow.py
17.32 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
AutoExpand.py
3.32 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
Bindings.py
2.97 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
CREDITS.txt
1.82 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
CallTipWindow.py
5.89 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
CallTips.py
5.79 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
ChangeLog
55.07 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
ClassBrowser.py
6.83 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
CodeContext.py
8.16 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
ColorDelegator.py
10.35 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
Debugger.py
18.32 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
Delegator.py
1.02 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
EditorWindow.py
63.91 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
FileList.py
3.72 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
FormatParagraph.py
7.12 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
GrepDialog.py
5 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
HISTORY.txt
10.07 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
HyperParser.py
12.58 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
IOBinding.py
19.75 KB
03/24/2025 03:36:58 PM
rw-r--r--
📁
Icons
-
05/08/2025 02:18:07 PM
rwxr-xr-x
📄
IdleHistory.py
3.96 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
MultiCall.py
18.14 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
MultiStatusBar.py
1.32 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
NEWS.txt
40.34 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
ObjectBrowser.py
3.88 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
OutputWindow.py
4.29 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
ParenMatch.py
6.56 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
PathBrowser.py
3.13 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
Percolator.py
3.1 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
PyParse.py
19.98 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
PyShell.py
57.45 KB
03/24/2025 03:37:40 PM
rwxr-xr-x
📄
README.txt
7.53 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
RemoteDebugger.py
11.73 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
RemoteObjectBrowser.py
964 bytes
03/24/2025 03:36:58 PM
rw-r--r--
📄
ReplaceDialog.py
7.31 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
RstripExtension.py
1.03 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
ScriptBinding.py
7.87 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
ScrolledList.py
4.27 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
SearchDialog.py
3.05 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
SearchDialogBase.py
6.84 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
SearchEngine.py
7.31 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
StackViewer.py
4.32 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
TODO.txt
8.28 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
ToolTip.py
3.1 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
TreeWidget.py
14.67 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
UndoDelegator.py
10.72 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
WidgetRedirector.py
6.78 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
WindowList.py
2.41 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
ZoomHeight.py
1.27 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
__init__.py
288 bytes
03/24/2025 03:36:58 PM
rw-r--r--
📄
__main__.py
159 bytes
03/24/2025 03:36:58 PM
rw-r--r--
📁
__pycache__
-
05/08/2025 02:18:07 PM
rwxr-xr-x
📄
aboutDialog.py
6.73 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
config-extensions.def
2.9 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
config-highlight.def
2.46 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
config-keys.def
7.59 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
config-main.def
2.5 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
configDialog.py
63.36 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
configHandler.py
31.44 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
configHelpSourceEdit.py
6.66 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
configSectionNameDialog.py
3.91 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
dynOptionMenuWidget.py
1.94 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
extend.txt
3.56 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
help.html
41.51 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
help.py
10.64 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
help.txt
17.48 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
idle.py
400 bytes
03/24/2025 03:36:58 PM
rw-r--r--
📄
idle.pyw
570 bytes
03/24/2025 03:36:58 PM
rw-r--r--
📄
idlever.py
415 bytes
03/24/2025 03:36:58 PM
rw-r--r--
📄
keybindingDialog.py
12.13 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
macosxSupport.py
8.48 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
rpc.py
20.3 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
run.py
13.35 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
tabbedpages.py
17.99 KB
03/24/2025 03:36:58 PM
rw-r--r--
📄
textView.py
3.15 KB
03/24/2025 03:36:58 PM
rw-r--r--
Editing: IdleHistory.py
Close
"Implement Idle Shell history mechanism with History class" from idlelib.configHandler import idleConf class History: ''' Implement Idle Shell history mechanism. store - Store source statement (called from PyShell.resetoutput). fetch - Fetch stored statement matching prefix already entered. history_next - Bound to <<history-next>> event (default Alt-N). history_prev - Bound to <<history-prev>> event (default Alt-P). ''' def __init__(self, text): '''Initialize data attributes and bind event methods. .text - Idle wrapper of tk Text widget, with .bell(). .history - source statements, possibly with multiple lines. .prefix - source already entered at prompt; filters history list. .pointer - index into history. .cyclic - wrap around history list (or not). ''' self.text = text self.history = [] self.prefix = None self.pointer = None self.cyclic = idleConf.GetOption("main", "History", "cyclic", 1, "bool") text.bind("<<history-previous>>", self.history_prev) text.bind("<<history-next>>", self.history_next) def history_next(self, event): "Fetch later statement; start with ealiest if cyclic." self.fetch(reverse=False) return "break" def history_prev(self, event): "Fetch earlier statement; start with most recent." self.fetch(reverse=True) return "break" def fetch(self, reverse): '''Fetch statememt and replace current line in text widget. Set prefix and pointer as needed for successive fetches. Reset them to None, None when returning to the start line. Sound bell when return to start line or cannot leave a line because cyclic is False. ''' nhist = len(self.history) pointer = self.pointer prefix = self.prefix if pointer is not None and prefix is not None: if self.text.compare("insert", "!=", "end-1c") or \ self.text.get("iomark", "end-1c") != self.history[pointer]: pointer = prefix = None self.text.mark_set("insert", "end-1c") # != after cursor move if pointer is None or prefix is None: prefix = self.text.get("iomark", "end-1c") if reverse: pointer = nhist # will be decremented else: if self.cyclic: pointer = -1 # will be incremented else: # abort history_next self.text.bell() return nprefix = len(prefix) while 1: pointer += -1 if reverse else 1 if pointer < 0 or pointer >= nhist: self.text.bell() if not self.cyclic and pointer < 0: # abort history_prev return else: if self.text.get("iomark", "end-1c") != prefix: self.text.delete("iomark", "end-1c") self.text.insert("iomark", prefix) pointer = prefix = None break item = self.history[pointer] if item[:nprefix] == prefix and len(item) > nprefix: self.text.delete("iomark", "end-1c") self.text.insert("iomark", item) break self.text.see("insert") self.text.tag_remove("sel", "1.0", "end") self.pointer = pointer self.prefix = prefix def store(self, source): "Store Shell input statement into history list." source = source.strip() if len(source) > 2: # avoid duplicates try: self.history.remove(source) except ValueError: pass self.history.append(source) self.pointer = None self.prefix = None if __name__ == "__main__": from unittest import main main('idlelib.idle_test.test_idlehistory', verbosity=2, exit=False)