Current Path: > > opt > alt > python34 > lib64 > python3.4 > idlelib > >
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
Icons | Directory | - | - | |
__pycache__ | Directory | - | - | |
idle_test | Directory | - | - | |
AutoComplete.py | File | 9202 bytes | April 17 2024 17:09:57. | |
AutoCompleteWindow.py | File | 17739 bytes | April 17 2024 17:09:57. | |
AutoExpand.py | File | 3395 bytes | April 17 2024 17:09:57. | |
Bindings.py | File | 3046 bytes | April 17 2024 17:09:57. | |
CREDITS.txt | File | 1865 bytes | March 18 2019 16:51:26. | |
CallTipWindow.py | File | 6034 bytes | April 17 2024 17:09:57. | |
CallTips.py | File | 5932 bytes | April 17 2024 17:09:57. | |
ChangeLog | File | 56393 bytes | March 18 2019 16:51:26. | |
ClassBrowser.py | File | 6999 bytes | April 17 2024 17:09:58. | |
CodeContext.py | File | 8348 bytes | April 17 2024 17:09:57. | |
ColorDelegator.py | File | 9695 bytes | April 17 2024 17:09:57. | |
Debugger.py | File | 18759 bytes | April 17 2024 17:09:57. | |
Delegator.py | File | 665 bytes | April 17 2024 17:09:57. | |
EditorWindow.py | File | 66059 bytes | April 17 2024 17:09:57. | |
FileList.py | File | 3813 bytes | April 17 2024 17:09:57. | |
FormatParagraph.py | File | 7287 bytes | April 17 2024 17:09:58. | |
GrepDialog.py | File | 5124 bytes | April 17 2024 17:09:58. | |
HISTORY.txt | File | 10317 bytes | March 18 2019 16:51:26. | |
HyperParser.py | File | 12877 bytes | April 17 2024 17:09:57. | |
IOBinding.py | File | 19773 bytes | April 17 2024 17:09:57. | |
IdleHistory.py | File | 4052 bytes | April 17 2024 17:09:58. | |
MultiCall.py | File | 18571 bytes | April 17 2024 17:09:57. | |
MultiStatusBar.py | File | 1348 bytes | April 17 2024 17:09:57. | |
NEWS.txt | File | 39835 bytes | March 18 2019 16:51:26. | |
ObjectBrowser.py | File | 3975 bytes | April 17 2024 17:09:57. | |
OutputWindow.py | File | 4394 bytes | April 17 2024 17:09:58. | |
ParenMatch.py | File | 6713 bytes | April 17 2024 17:09:57. | |
PathBrowser.py | File | 3207 bytes | April 17 2024 17:09:57. | |
Percolator.py | File | 3244 bytes | April 17 2024 17:09:58. | |
PyParse.py | File | 20461 bytes | April 17 2024 17:09:57. | |
PyShell.py | File | 58450 bytes | April 17 2024 17:09:57. | |
README.txt | File | 7709 bytes | March 18 2019 16:51:26. | |
RemoteDebugger.py | File | 12007 bytes | April 17 2024 17:09:57. | |
RemoteObjectBrowser.py | File | 964 bytes | April 17 2024 17:09:57. | |
ReplaceDialog.py | File | 6640 bytes | April 17 2024 17:09:57. | |
RstripExtension.py | File | 1050 bytes | April 17 2024 17:09:57. | |
ScriptBinding.py | File | 8061 bytes | April 17 2024 17:09:57. | |
ScrolledList.py | File | 4375 bytes | April 17 2024 17:09:57. | |
SearchDialog.py | File | 2630 bytes | April 17 2024 17:09:57. | |
SearchDialogBase.py | File | 7009 bytes | April 17 2024 17:09:57. | |
SearchEngine.py | File | 7485 bytes | April 17 2024 17:09:58. | |
StackViewer.py | File | 4426 bytes | April 17 2024 17:09:58. | |
TODO.txt | File | 8478 bytes | March 18 2019 16:51:26. | |
ToolTip.py | File | 3173 bytes | April 17 2024 17:09:58. | |
TreeWidget.py | File | 15024 bytes | April 17 2024 17:09:57. | |
UndoDelegator.py | File | 10815 bytes | April 17 2024 17:09:57. | |
WidgetRedirector.py | File | 6869 bytes | April 17 2024 17:09:57. | |
WindowList.py | File | 2472 bytes | April 17 2024 17:09:57. | |
ZoomHeight.py | File | 1300 bytes | April 17 2024 17:09:58. | |
__init__.py | File | 288 bytes | April 17 2024 17:09:57. | |
__main__.py | File | 159 bytes | April 17 2024 17:09:57. | |
aboutDialog.py | File | 6688 bytes | April 17 2024 17:09:57. | |
config-extensions.def | File | 2965 bytes | March 18 2019 16:51:26. | |
config-highlight.def | File | 2515 bytes | March 18 2019 16:51:26. | |
config-keys.def | File | 7777 bytes | March 18 2019 16:51:26. | |
config-main.def | File | 2563 bytes | March 18 2019 16:51:26. | |
configDialog.py | File | 64305 bytes | April 17 2024 17:09:57. | |
configHandler.py | File | 32197 bytes | April 17 2024 17:09:57. | |
configHelpSourceEdit.py | File | 6670 bytes | April 17 2024 17:09:57. | |
configSectionNameDialog.py | File | 4007 bytes | April 17 2024 17:09:57. | |
dynOptionMenuWidget.py | File | 1990 bytes | April 17 2024 17:09:57. | |
extend.txt | File | 3642 bytes | March 18 2019 16:51:26. | |
help.html | File | 41126 bytes | March 18 2019 16:51:26. | |
help.py | File | 9701 bytes | April 17 2024 17:09:57. | |
help.txt | File | 17900 bytes | March 18 2019 16:51:26. | |
idle.py | File | 400 bytes | April 17 2024 17:09:57. | |
idle.pyw | File | 570 bytes | March 18 2019 16:51:26. | |
idlever.py | File | 415 bytes | April 17 2024 17:09:57. | |
keybindingDialog.py | File | 12416 bytes | April 17 2024 17:09:57. | |
macosxSupport.py | File | 8684 bytes | April 17 2024 17:09:57. | |
rpc.py | File | 20782 bytes | April 17 2024 17:09:57. | |
run.py | File | 13673 bytes | April 17 2024 17:09:57. | |
tabbedpages.py | File | 18418 bytes | April 17 2024 17:09:57. | |
textView.py | File | 3225 bytes | April 17 2024 17:09:57. |
"""AutoComplete.py - An IDLE extension for automatically completing names. This extension can complete either attribute names of file names. It can pop a window with all available names, for the user to select from. """ import os import sys import string from idlelib.configHandler import idleConf # This string includes all chars that may be in an identifier ID_CHARS = string.ascii_letters + string.digits + "_" # These constants represent the two different types of completions COMPLETE_ATTRIBUTES, COMPLETE_FILES = range(1, 2+1) from idlelib import AutoCompleteWindow from idlelib.HyperParser import HyperParser import __main__ SEPS = os.sep if os.altsep: # e.g. '/' on Windows... SEPS += os.altsep class AutoComplete: menudefs = [ ('edit', [ ("Show Completions", "<<force-open-completions>>"), ]) ] popupwait = idleConf.GetOption("extensions", "AutoComplete", "popupwait", type="int", default=0) def __init__(self, editwin=None): self.editwin = editwin if editwin is None: # subprocess and test return self.text = editwin.text self.autocompletewindow = None # id of delayed call, and the index of the text insert when the delayed # call was issued. If _delayed_completion_id is None, there is no # delayed call. self._delayed_completion_id = None self._delayed_completion_index = None def _make_autocomplete_window(self): return AutoCompleteWindow.AutoCompleteWindow(self.text) def _remove_autocomplete_window(self, event=None): if self.autocompletewindow: self.autocompletewindow.hide_window() self.autocompletewindow = None def force_open_completions_event(self, event): """Happens when the user really wants to open a completion list, even if a function call is needed. """ self.open_completions(True, False, True) def try_open_completions_event(self, event): """Happens when it would be nice to open a completion list, but not really necessary, for example after an dot, so function calls won't be made. """ lastchar = self.text.get("insert-1c") if lastchar == ".": self._open_completions_later(False, False, False, COMPLETE_ATTRIBUTES) elif lastchar in SEPS: self._open_completions_later(False, False, False, COMPLETE_FILES) def autocomplete_event(self, event): """Happens when the user wants to complete his word, and if necessary, open a completion list after that (if there is more than one completion) """ if hasattr(event, "mc_state") and event.mc_state: # A modifier was pressed along with the tab, continue as usual. return if self.autocompletewindow and self.autocompletewindow.is_active(): self.autocompletewindow.complete() return "break" else: opened = self.open_completions(False, True, True) if opened: return "break" def _open_completions_later(self, *args): self._delayed_completion_index = self.text.index("insert") if self._delayed_completion_id is not None: self.text.after_cancel(self._delayed_completion_id) self._delayed_completion_id = \ self.text.after(self.popupwait, self._delayed_open_completions, *args) def _delayed_open_completions(self, *args): self._delayed_completion_id = None if self.text.index("insert") != self._delayed_completion_index: return self.open_completions(*args) def open_completions(self, evalfuncs, complete, userWantsWin, mode=None): """Find the completions and create the AutoCompleteWindow. Return True if successful (no syntax error or so found). if complete is True, then if there's nothing to complete and no start of completion, won't open completions and return False. If mode is given, will open a completion list only in this mode. """ # Cancel another delayed call, if it exists. if self._delayed_completion_id is not None: self.text.after_cancel(self._delayed_completion_id) self._delayed_completion_id = None hp = HyperParser(self.editwin, "insert") curline = self.text.get("insert linestart", "insert") i = j = len(curline) if hp.is_in_string() and (not mode or mode==COMPLETE_FILES): # Find the beginning of the string # fetch_completions will look at the file system to determine whether the # string value constitutes an actual file name # XXX could consider raw strings here and unescape the string value if it's # not raw. self._remove_autocomplete_window() mode = COMPLETE_FILES # Find last separator or string start while i and curline[i-1] not in "'\"" + SEPS: i -= 1 comp_start = curline[i:j] j = i # Find string start while i and curline[i-1] not in "'\"": i -= 1 comp_what = curline[i:j] elif hp.is_in_code() and (not mode or mode==COMPLETE_ATTRIBUTES): self._remove_autocomplete_window() mode = COMPLETE_ATTRIBUTES while i and (curline[i-1] in ID_CHARS or ord(curline[i-1]) > 127): i -= 1 comp_start = curline[i:j] if i and curline[i-1] == '.': hp.set_index("insert-%dc" % (len(curline)-(i-1))) comp_what = hp.get_expression() if not comp_what or \ (not evalfuncs and comp_what.find('(') != -1): return else: comp_what = "" else: return if complete and not comp_what and not comp_start: return comp_lists = self.fetch_completions(comp_what, mode) if not comp_lists[0]: return self.autocompletewindow = self._make_autocomplete_window() return not self.autocompletewindow.show_window( comp_lists, "insert-%dc" % len(comp_start), complete, mode, userWantsWin) def fetch_completions(self, what, mode): """Return a pair of lists of completions for something. The first list is a sublist of the second. Both are sorted. If there is a Python subprocess, get the comp. list there. Otherwise, either fetch_completions() is running in the subprocess itself or it was called in an IDLE EditorWindow before any script had been run. The subprocess environment is that of the most recently run script. If two unrelated modules are being edited some calltips in the current module may be inoperative if the module was not the last to run. """ try: rpcclt = self.editwin.flist.pyshell.interp.rpcclt except: rpcclt = None if rpcclt: return rpcclt.remotecall("exec", "get_the_completion_list", (what, mode), {}) else: if mode == COMPLETE_ATTRIBUTES: if what == "": namespace = __main__.__dict__.copy() namespace.update(__main__.__builtins__.__dict__) bigl = eval("dir()", namespace) bigl.sort() if "__all__" in bigl: smalll = sorted(eval("__all__", namespace)) else: smalll = [s for s in bigl if s[:1] != '_'] else: try: entity = self.get_entity(what) bigl = dir(entity) bigl.sort() if "__all__" in bigl: smalll = sorted(entity.__all__) else: smalll = [s for s in bigl if s[:1] != '_'] except: return [], [] elif mode == COMPLETE_FILES: if what == "": what = "." try: expandedpath = os.path.expanduser(what) bigl = os.listdir(expandedpath) bigl.sort() smalll = [s for s in bigl if s[:1] != '.'] except OSError: return [], [] if not smalll: smalll = bigl return smalll, bigl def get_entity(self, name): """Lookup name in a namespace spanning sys.modules and __main.dict__""" namespace = sys.modules.copy() namespace.update(__main__.__dict__) return eval(name, namespace) if __name__ == '__main__': from unittest import main main('idlelib.idle_test.test_autocomplete', verbosity=2)
SILENT KILLER Tool