✘✘ 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//calltip.py
"""Pop up a reminder of how to call a function.

Call Tips are floating windows which display function, class, and method
parameter and docstring information when you type an opening parenthesis, and
which disappear when you type a closing parenthesis.
"""
import __main__
import inspect
import re
import sys
import textwrap
import types

from idlelib import calltip_w
from idlelib.hyperparser import HyperParser


class Calltip:

    def __init__(self, editwin=None):
        if editwin is None:  # subprocess and test
            self.editwin = None
        else:
            self.editwin = editwin
            self.text = editwin.text
            self.active_calltip = None
            self._calltip_window = self._make_tk_calltip_window

    def close(self):
        self._calltip_window = None

    def _make_tk_calltip_window(self):
        # See __init__ for usage
        return calltip_w.CalltipWindow(self.text)

    def remove_calltip_window(self, event=None):
        if self.active_calltip:
            self.active_calltip.hidetip()
            self.active_calltip = None

    def force_open_calltip_event(self, event):
        "The user selected the menu entry or hotkey, open the tip."
        self.open_calltip(True)
        return "break"

    def try_open_calltip_event(self, event):
        """Happens when it would be nice to open a calltip, but not really
        necessary, for example after an opening bracket, so function calls
        won't be made.
        """
        self.open_calltip(False)

    def refresh_calltip_event(self, event):
        if self.active_calltip and self.active_calltip.tipwindow:
            self.open_calltip(False)

    def open_calltip(self, evalfuncs):
        """Maybe close an existing calltip and maybe open a new calltip.

        Called from (force_open|try_open|refresh)_calltip_event functions.
        """
        hp = HyperParser(self.editwin, "insert")
        sur_paren = hp.get_surrounding_brackets('(')

        # If not inside parentheses, no calltip.
        if not sur_paren:
            self.remove_calltip_window()
            return

        # If a calltip is shown for the current parentheses, do
        # nothing.
        if self.active_calltip:
            opener_line, opener_col = map(int, sur_paren[0].split('.'))
            if (
                (opener_line, opener_col) ==
                (self.active_calltip.parenline, self.active_calltip.parencol)
            ):
                return

        hp.set_index(sur_paren[0])
        try:
            expression = hp.get_expression()
        except ValueError:
            expression = None
        if not expression:
            # No expression before the opening parenthesis, e.g.
            # because it's in a string or the opener for a tuple:
            # Do nothing.
            return

        # At this point, the current index is after an opening
        # parenthesis, in a section of code, preceded by a valid
        # expression. If there is a calltip shown, it's not for the
        # same index and should be closed.
        self.remove_calltip_window()

        # Simple, fast heuristic: If the preceding expression includes
        # an opening parenthesis, it likely includes a function call.
        if not evalfuncs and (expression.find('(') != -1):
            return

        argspec = self.fetch_tip(expression)
        if not argspec:
            return
        self.active_calltip = self._calltip_window()
        self.active_calltip.showtip(argspec, sur_paren[0], sur_paren[1])

    def fetch_tip(self, expression):
        """Return the argument list and docstring of a function or class.

        If there is a Python subprocess, get the calltip there.  Otherwise,
        either this fetch_tip() is running in the subprocess or it was
        called in an IDLE running without the subprocess.

        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.

        To find methods, fetch_tip must be fed a fully qualified name.

        """
        try:
            rpcclt = self.editwin.flist.pyshell.interp.rpcclt
        except AttributeError:
            rpcclt = None
        if rpcclt:
            return rpcclt.remotecall("exec", "get_the_calltip",
                                     (expression,), {})
        else:
            return get_argspec(get_entity(expression))


def get_entity(expression):
    """Return the object corresponding to expression evaluated
    in a namespace spanning sys.modules and __main.dict__.
    """
    if expression:
        namespace = {**sys.modules, **__main__.__dict__}
        try:
            return eval(expression, namespace)  # Only protect user code.
        except BaseException:
            # An uncaught exception closes idle, and eval can raise any
            # exception, especially if user classes are involved.
            return None

# The following are used in get_argspec and some in tests
_MAX_COLS = 85
_MAX_LINES = 5  # enough for bytes
_INDENT = ' '*4  # for wrapped signatures
_first_param = re.compile(r'(?<=\()\w*\,?\s*')
_default_callable_argspec = "See source or doc"
_invalid_method = "invalid method signature"

def get_argspec(ob):
    '''Return a string describing the signature of a callable object, or ''.

    For Python-coded functions and methods, the first line is introspected.
    Delete 'self' parameter for classes (.__init__) and bound methods.
    The next lines are the first lines of the doc string up to the first
    empty line or _MAX_LINES.    For builtins, this typically includes
    the arguments in addition to the return value.
    '''
    # Determine function object fob to inspect.
    try:
        ob_call = ob.__call__
    except BaseException:  # Buggy user object could raise anything.
        return ''  # No popup for non-callables.
    # For Get_argspecTest.test_buggy_getattr_class, CallA() & CallB().
    fob = ob_call if isinstance(ob_call, types.MethodType) else ob

    # Initialize argspec and wrap it to get lines.
    try:
        argspec = str(inspect.signature(fob))
    except Exception as err:
        msg = str(err)
        if msg.startswith(_invalid_method):
            return _invalid_method
        else:
            argspec = ''

    if isinstance(fob, type) and argspec == '()':
        # If fob has no argument, use default callable argspec.
        argspec = _default_callable_argspec

    lines = (textwrap.wrap(argspec, _MAX_COLS, subsequent_indent=_INDENT)
             if len(argspec) > _MAX_COLS else [argspec] if argspec else [])

    # Augment lines from docstring, if any, and join to get argspec.
    doc = inspect.getdoc(ob)
    if doc:
        for line in doc.split('\n', _MAX_LINES)[:_MAX_LINES]:
            line = line.strip()
            if not line:
                break
            if len(line) > _MAX_COLS:
                line = line[: _MAX_COLS - 3] + '...'
            lines.append(line)
    argspec = '\n'.join(lines)

    return argspec or _default_callable_argspec


if __name__ == '__main__':
    from unittest import main
    main('idlelib.idle_test.test_calltip', 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