✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ beluga.o2switch.net ​🇻​♯➤ 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 185.154.139.77 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.23
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/alt/python310/lib64/python3.10/idlelib//autocomplete.py
"""Complete either attribute names or file names.

Either on demand or after a user-selected delay after a key character,
pop up a list of candidates.
"""
import __main__
import keyword
import os
import string
import sys

# Modified keyword list is used in fetch_completions.
completion_kwds = [s for s in keyword.kwlist
                     if s not in {'True', 'False', 'None'}]  # In builtins.
completion_kwds.extend(('match', 'case'))  # Context keywords.
completion_kwds.sort()

# Two types of completions; defined here for autocomplete_w import below.
ATTRS, FILES = 0, 1
from idlelib import autocomplete_w
from idlelib.config import idleConf
from idlelib.hyperparser import HyperParser

# Tuples passed to open_completions.
#       EvalFunc, Complete, WantWin, Mode
FORCE = True,     False,    True,    None   # Control-Space.
TAB   = False,    True,     True,    None   # Tab.
TRY_A = False,    False,    False,   ATTRS  # '.' for attributes.
TRY_F = False,    False,    False,   FILES  # '/' in quotes for file name.

# This string includes all chars that may be in an identifier.
# TODO Update this here and elsewhere.
ID_CHARS = string.ascii_letters + string.digits + "_"

SEPS = f"{os.sep}{os.altsep if os.altsep else ''}"
TRIGGERS = f".{SEPS}"

class AutoComplete:

    def __init__(self, editwin=None, tags=None):
        self.editwin = editwin
        if editwin is not None:   # not in subprocess or no-gui test
            self.text = editwin.text
        self.tags = tags
        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

    @classmethod
    def reload(cls):
        cls.popupwait = idleConf.GetOption(
            "extensions", "AutoComplete", "popupwait", type="int", default=0)

    def _make_autocomplete_window(self):  # Makes mocking easier.
        return autocomplete_w.AutoCompleteWindow(self.text, tags=self.tags)

    def _remove_autocomplete_window(self, event=None):
        if self.autocompletewindow:
            self.autocompletewindow.hide_window()
            self.autocompletewindow = None

    def force_open_completions_event(self, event):
        "(^space) Open completion list, even if a function call is needed."
        self.open_completions(FORCE)
        return "break"

    def autocomplete_event(self, event):
        "(tab) Complete word or open list if multiple options."
        if hasattr(event, "mc_state") and event.mc_state or\
                not self.text.get("insert linestart", "insert").strip():
            # A modifier was pressed along with the tab or
            # there is only previous whitespace on this line, so tab.
            return None
        if self.autocompletewindow and self.autocompletewindow.is_active():
            self.autocompletewindow.complete()
            return "break"
        else:
            opened = self.open_completions(TAB)
            return "break" if opened else None

    def try_open_completions_event(self, event=None):
        "(./) Open completion list after pause with no movement."
        lastchar = self.text.get("insert-1c")
        if lastchar in TRIGGERS:
            args = TRY_A if lastchar == "." else TRY_F
            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):
        "Call open_completions if index unchanged."
        self._delayed_completion_id = None
        if self.text.index("insert") == self._delayed_completion_index:
            self.open_completions(args)

    def open_completions(self, args):
        """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.
        """
        evalfuncs, complete, wantwin, mode = args
        # 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==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 = 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==ATTRS):
            self._remove_autocomplete_window()
            mode = ATTRS
            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] == '.':  # Need object with attributes.
                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 None
            else:
                comp_what = ""
        else:
            return None

        if complete and not comp_what and not comp_start:
            return None
        comp_lists = self.fetch_completions(comp_what, mode)
        if not comp_lists[0]:
            return None
        self.autocompletewindow = self._make_autocomplete_window()
        return not self.autocompletewindow.show_window(
                comp_lists, "insert-%dc" % len(comp_start),
                complete, mode, wantwin)

    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 == ATTRS:
                if what == "":  # Main module names.
                    namespace = {**__main__.__builtins__.__dict__,
                                 **__main__.__dict__}
                    bigl = eval("dir()", namespace)
                    bigl.extend(completion_kwds)
                    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 == 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__."
        return eval(name, {**sys.modules, **__main__.__dict__})


AutoComplete.reload()

if __name__ == '__main__':
    from unittest import main
    main('idlelib.idle_test.test_autocomplete', verbosity=2)


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
3 Sep 2026 4.09 AM
root / linksafe
0755
Icons
--
3 Sep 2026 4.11 AM
root / linksafe
0755
__pycache__
--
3 Sep 2026 4.11 AM
root / linksafe
0755
idle_test
--
3 Sep 2026 4.11 AM
root / linksafe
0755
CREDITS.txt
2.102 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
ChangeLog
55.039 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
HISTORY.txt
10.07 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
NEWS.txt
52.925 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
NEWS2x.txt
26.535 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
README.txt
11.38 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
TODO.txt
8.279 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
__init__.py
0.387 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
__main__.py
0.155 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
autocomplete.py
9.135 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
autocomplete_w.py
20.603 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
autoexpand.py
3.141 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
browser.py
8.385 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
calltip.py
7.097 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
calltip_w.py
6.99 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
codecontext.py
11.152 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
colorizer.py
14.427 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
config-extensions.def
2.213 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
config-highlight.def
2.797 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
config-keys.def
10.654 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
config-main.def
3.094 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
config.py
37.279 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
config_key.py
14.873 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
configdialog.py
103.25 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
debugger.py
18.656 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
debugger_r.py
11.882 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
debugobj.py
3.96 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
debugobj_r.py
1.057 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
delegator.py
1.019 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
dynoption.py
1.944 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
editor.py
64.829 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
extend.txt
3.546 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
filelist.py
3.785 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
format.py
15.407 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
grep.py
7.304 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
help.html
77.271 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
help.py
11.577 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
help_about.py
8.893 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
history.py
3.969 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
hyperparser.py
12.587 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
idle.py
0.443 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
idle.pyw
0.557 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
iomenu.py
15.597 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
macosx.py
9.912 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
mainmenu.py
3.846 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
multicall.py
18.211 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
outwin.py
5.575 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
parenmatch.py
7.035 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
pathbrowser.py
3.118 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
percolator.py
3.463 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
pyparse.py
19.398 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
pyshell.py
61.508 KB
12 Aug 2026 11.03 PM
root / linksafe
0755
query.py
14.722 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
redirector.py
6.714 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
replace.py
9.765 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
rpc.py
20.588 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
run.py
21 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
runscript.py
8.079 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
scrolledlist.py
4.36 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
search.py
5.436 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
searchbase.py
7.672 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
searchengine.py
7.192 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
sidebar.py
19.88 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
squeezer.py
12.533 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
stackviewer.py
4.35 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
statusbar.py
1.438 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
textview.py
6.653 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
tooltip.py
6.403 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
tree.py
15.986 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
undo.py
10.787 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
util.py
0.685 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
window.py
2.555 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
zoomheight.py
4.104 KB
12 Aug 2026 11.03 PM
root / linksafe
0644
zzdummy.py
1.958 KB
12 Aug 2026 11.03 PM
root / linksafe
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF