| Server IP : 35.80.110.71 / Your IP : 216.73.216.221 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/jedi/__pycache__/ |
Upload File : |
�
eH � �f � d Z ddlZddlmZ ddlZddlZddlZddlZddlZddl m
Z
dZedfd�Zd� Z
y)z
Utilities for end-users.
� N)�
namedtuple)�InterpreterFc �� � �� t r&t j ddt j �� G �� fd�d� } ddl}ddl}|j
|� j � |j d� |j d � |j d
� |j d� |j d� |j d
� y# t $ r t d� Y yw xY w)a�
This function sets up :mod:`readline` to use Jedi in a Python interactive
shell.
If you want to use a custom ``PYTHONSTARTUP`` file (typically
``$HOME/.pythonrc.py``), you can add this piece of code::
try:
from jedi.utils import setup_readline
except ImportError:
# Fallback to the stdlib readline completer if it is installed.
# Taken from http://docs.python.org/2/library/rlcompleter.html
print("Jedi is not installed, falling back to readline")
try:
import readline
import rlcompleter
readline.parse_and_bind("tab: complete")
except ImportError:
print("Readline is not installed either. No tab completion is enabled.")
else:
setup_readline()
This will fallback to the readline completer if Jedi is not installed.
The readline completer will only complete names in the global namespace,
so for example::
ran<TAB>
will complete to ``range``.
With Jedi the following code::
range(10).cou<TAB>
will complete to ``range(10).count``, this does not work with the default
cPython :mod:`readline` completer.
You will also need to add ``export PYTHONSTARTUP=$HOME/.pythonrc.py`` to
your shell profile (usually ``.bash_profile`` or ``.profile`` if you use
bash).
z
/tmp/jedi.log�a)�filename�filemode�levelc � �� e Zd Z� �fd�Zy)�setup_readline.<locals>.JediRLc �� �� |dk( r�t j j dt j � � t j dt |� z � t |�j g� }|j ��� }t j d|� |D �cg c]* }|dt |� |j z
|j z ��, c}| _ t j j% d� | j | S c c}w # t j dt! j"